From: Phrogz Date: 2007-01-26T09:20:12+09:00 Subject: Re: Ruby language question On Jan 25, 5:02 pm, Neville Franks wrote: > def size=(val) # what does this mean > @size = val > end Methods whose names end in an '=' character can be called with a space between the method name and the '=' character. Combined with the ability to leave parentheses off a method call, it looks very much like you're assigning to an attribute, when you're calling a method: irb(main):001:0> class Foo; def a=( b ); p b; end; end => nil irb(main):002:0> f = Foo.new => # irb(main):003:0> f.a=(1) 1 => 1 irb(main):004:0> f.a =( 2 ) 2 => 2 irb(main):005:0> f.a= 3 3 => 3 irb(main):006:0> f.a = 4 4 => 4 One thing to note - the single argument passed to the function under this syntax is also always the return value. (In the above, the #p method returns nil, but you can see that the return value of the method is the 'rvalue' for the 'assignment'.