[ create a new paste ] login | about

Link: http://codepad.org/VUgCVPXN    [ raw code | output | fork ]

Ruby, pasted on Aug 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
 module Familiar
      #this will not work
        def ask_age
          return "How old are you?"
        end
      #this will work
        def Familiar::greeting
          return "What's up?"
        end
    end
    # this call returns **NoMethodError** 
    puts(Familiar::ask_age()) 
    puts(Familiar::greeting()) 


Output:
1
Line 12: undefined method `ask_age' for Familiar:Module (NoMethodError)


Create a new paste based on this one


Comments: