Skip to content

Instantly share code, notes, and snippets.

@mchung
Created October 21, 2008 00:54
Show Gist options
  • Save mchung/18224 to your computer and use it in GitHub Desktop.
Save mchung/18224 to your computer and use it in GitHub Desktop.
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