watch this: http://www.youtube.com/watch?v=iLxKNUFHAnY


On Tue, Feb 26, 2013 at 12:05 PM, Love U Ruby <lists / ruby-forum.com> wrote:

> >> class Test
> >> m=self
> >> def self.show
> >> print "hi"
> >> end
> >> def display
> >> m.show
> >> end
> >> end
> => nil
>
> Why does the below error come? can anyone help me here?
>
> >> foo = Test.new
> => #<Test:0x0000000106f9b8>
> >> foo.display
> NameError: undefined local variable or method `m' for
> #<Test:0x0000000106f9b8>
>   from (irb):7:in `display'
>   from (irb):11
>   from /usr/bin/irb:12:in `<main>'
>
> --
> Posted via http://www.ruby-forum.com/.
>
>