Created
April 27, 2011 17:12
-
-
Save crystalneth/944711 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Bar | |
def bar | |
puts "bar" | |
end | |
end | |
class Foo | |
include Bar | |
bar | |
end |
Perhaps you're looking for something like:
irb(main):013:0> class Test
irb(main):014:1> def self.test_me
irb(main):015:2> puts "testing!"
irb(main):016:2> end
irb(main):017:1> test_me
irb(main):018:1> end
testing!
=> nil
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ruby test.rb
'test.rb:9:in
<class:Foo>': undefined local variable or method
bar' for Foo:Class (NameError)from test.rb:7:in `