Created
October 21, 2008 00:54
-
-
Save mchung/18224 to your computer and use it in GitHub Desktop.
This file contains 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
class Selfoo | |
# bar # Why doesn't this work? | |
def self.foo | |
puts "foo" | |
end | |
class << self | |
# puts foo # Why doesn't this work? | |
def bar | |
puts "bar" | |
end | |
end | |
def deftest | |
self.class.foo | |
end | |
end | |
# Selfoo.foo | |
# Selfoo.bar | |
# Selfoo.new.deftest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment