From: Jason Roelofs Date: 2009-03-02T23:27:24+09:00 Subject: Re: What does this statement do? On Mon, Mar 2, 2009 at 9:18 AM, Stanislaw Wozniak wrote: > Stanislaw Wozniak wrote: >> Hi Guys, >> >> I have been wondering what does this statement do and what does it set. >> It interferes with my methods_missing handler: >> >> {code} >> class MyClass >> >>    something = "something else" >> >> end >> {code} > > I guess this is assigning a string to a variable that is created in the > MyClass scope. But my problem is that I have some setter methods that > I'm using through method_missing, but method_missing is never triggered > because it is assigning stuff just like in the example above. > -- > Posted via http://www.ruby-forum.com/. > > That statement is the same as calling MyClass.something=("something else") If you want method_missing to catch it, you need to define a method_missing on the class itself, like this: class MyClass def self.method_missing(name, *args) end end Jason