Skip to content

Instantly share code, notes, and snippets.

@ymendel
Created August 5, 2010 22:14
Show Gist options
  • Save ymendel/510486 to your computer and use it in GitHub Desktop.
Save ymendel/510486 to your computer and use it in GitHub Desktop.
class Foo
class << self
def some_method
Bar.some_method
end
end
end
class Bar < Foo
class << self
def some_method
# some awesome code here
end
end
end
class Foo
class << self
def new(arg)
obj = Bar.allocate
obj.send(:initialize, arg)
obj
end
def method_missing(meth, *args)
Bar.send(meth, *args)
end
end
end
class Bar < Foo
# you know it
end
class Bar
end
Foo = Bar # aww yeah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment