Skip to content

Instantly share code, notes, and snippets.

View jasonknight's full-sized avatar

Jason Martin jasonknight

View GitHub Profile
@jasonknight
jasonknight / gist:2377719
Created April 13, 2012 15:29
Inheritance vs NameSpace
module SomeThing
class SomethingElse;end
def self.inside
x = AllTogetherDifferent.new
# Works because all constants are Global
puts x.inspect
# x = SomeThing::AllTogetherDifferent.new
# Produces in `inside': uninitialized constant SomeThing::AllTogetherDifferent (NameError)
x = SomeThing::SomethingElse::AllTogetherDifferent.new
puts x.inspect