[Rails] Why Does def some_func=(obj) Behave This Way?

2014-01-20 Thread Peter
Hello Everyone, Why does this function behave this way? class Confuse def confusion=(obj) @obj = obj return 'expected answer' end end c = Confuse.new c.confusion = 'this should be wrong' This returns 'this should be wrong'. I am reading *Programming Ruby 1.9 2.0* by

Re: [Rails] Why Does def some_func=(obj) Behave This Way?

2014-01-20 Thread Jordon Bedwell
On Mon, Jan 20, 2014 at 1:30 PM, Peter pe...@poproj.com wrote: class Confuse def confusion=(obj) @obj = obj return 'expected answer' end end c = Confuse.new c.confusion = 'this should be wrong' This returns 'this should be wrong'. Ruby setters always ignore your explicit