Skip to content

Instantly share code, notes, and snippets.

@JonathonMA
Created June 17, 2014 03:08
Show Gist options
  • Save JonathonMA/f2b2ab11da5a085de9ab to your computer and use it in GitHub Desktop.
Save JonathonMA/f2b2ab11da5a085de9ab to your computer and use it in GitHub Desktop.
class Foo
class << self
def hello
"hello"
end
end
end
def singleton &block
singleton_class.class_eval &block
end
class Bar
singleton do
def hello
"NO HELLO"
end
end
end
puts Foo.hello
puts Bar.hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment