Skip to content

Instantly share code, notes, and snippets.

@Sixeight
Created November 26, 2009 16:47
Show Gist options
  • Select an option

  • Save Sixeight/243560 to your computer and use it in GitHub Desktop.

Select an option

Save Sixeight/243560 to your computer and use it in GitHub Desktop.
class << (
class Klass
def hi
p 'hi from instance'
end
self
end)
def hi
p 'hi from class'
end
end
Klass.hi # => "hi from class"
Klass.new.hi # => "hi from instance"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment