Skip to content

Instantly share code, notes, and snippets.

@etiennebarrie
Created March 10, 2011 15:57
Show Gist options
  • Select an option

  • Save etiennebarrie/864326 to your computer and use it in GitHub Desktop.

Select an option

Save etiennebarrie/864326 to your computer and use it in GitHub Desktop.
class Foo
CONST = 42
end
class Bar < Foo
def self.foo
CONST
end
class << self
def bar
CONST
end
def bar_correct
self::CONST
end
end
end
p Bar.foo
p Bar.bar rescue puts $!
p Bar.bar_correct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment