From: Joel VanderWerf Date: 2010-11-03T03:25:20+09:00 Subject: Re: the dark side of inherited methods On 11/02/2010 11:12 AM, James Edward Gray II wrote: > A = Struct.new(:x, :y, :z) do > def length > Math.sqrt(x**2 + y**2 + z**2) > end > end How do you fix this? A = Struct.new :x, :y, :z do def length Math.sqrt(x**2 + y**2 + z**2) end def x=(new_x) raise ArgumentError if new_x > 100 super end end a = A.new a.x = 1 # NoMethodError