Skip to content

Instantly share code, notes, and snippets.

@hkurokawa
Created August 8, 2017 05:10
Show Gist options
  • Save hkurokawa/bd26ca9628eb503ef1f2ce01fda248da to your computer and use it in GitHub Desktop.
Save hkurokawa/bd26ca9628eb503ef1f2ce01fda248da to your computer and use it in GitHub Desktop.
class A
FOO = 'foo'
end
class B < A
def self.foo
p FOO
end
class << self
def foo2
p self::FOO # it doesn't compile without self::!
end
end
end
B.foo
B.foo2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment