Skip to content

Instantly share code, notes, and snippets.

@letsbreelhere
Created June 18, 2012 18:49
Show Gist options
  • Save letsbreelhere/2949989 to your computer and use it in GitHub Desktop.
Save letsbreelhere/2949989 to your computer and use it in GitHub Desktop.
>> module M
>> def foo
>> self.class::FOO
>> end
>> end
=> nil
>> class A; FOO = 1; extend M; end
=> A
>> class B; FOO = 42; extend M; end
=> B
>> A.foo
NameError: uninitialized constant Class::FOO
from (irb):3:in `foo'
from (irb):9
from /Users/brianstanwyck/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment