From: Nathan Beyer Date: 2010-03-12T08:55:25+09:00 Subject: result of assignment is not the return value Given a simple class like this class MyClass attr_reader :value def value=(val) @value = val.to_s end end Why the the following code return the value passed and not the value assigned? c = MyClass.new result = c.value = 2 puts result puts c.value This is currently outputing 2 "2" The results are the same when MyClass is modified to be this. class MyClass attr_reader :value def value=(val) @value = val.to_s return @value end end Shouldn't the result of the 'value=' method be the return value?