Skip to content

Instantly share code, notes, and snippets.

@theoretick
Last active March 2, 2016 18:39
Show Gist options
  • Save theoretick/c7c82a9d65b87cb27df8 to your computer and use it in GitHub Desktop.
Save theoretick/c7c82a9d65b87cb27df8 to your computer and use it in GitHub Desktop.
10:21:48 $ irb
irb(main):001:0> module FooA
irb(main):002:1> BAR = "bar"
irb(main):003:1> end
=> "bar"
irb(main):004:0> FooA::BAR
=> "bar"
irb(main):005:0> module FooB
irb(main):006:1> class << self
irb(main):007:2> BAR = "bar"
irb(main):008:2> end
irb(main):009:1> end
=> "bar"
irb(main):010:0> FooB::BAR
NameError: uninitialized constant FooB::BAR
from (irb):10
from /Users/lucas/.rbenv/versions/2.1.2/bin/irb:11:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment