Nice, so method_missing is called when I call a method that I didn't
defined myself?

Thanks,

Diego

On Fri, Sep 17, 2010 at 6:37 AM, Brian Candler <b.candler / pobox.com> wrote:
> Diego Viola wrote:
>> I've been using Ruby for 2 years or more now, and I am still learning
>> this awesome language. But I can't grasp my head about method_missing
>> and how it works, can someone please help me understand about how
>> method_missing works?
>
> class Foo
> =A0def bar(*args)
> =A0 =A0puts "You called bar with #{args.inspect}"
> =A0end
> =A0def method_missing(*args)
> =A0 =A0puts "method_missing with #{args.inspect}"
> =A0end
> end
>
> f =3D Foo.new
> f.bar(1,2,3)
> f.wibble(4,5,6)
> --
> Posted via http://www.ruby-forum.com/.
>
>