Last active
August 29, 2015 14:17
-
-
Save zeisler/58ee98c4a35c2f546b60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sharer | |
def initalizer(stuff_name) | |
@stuff_name = stuff_name | |
end | |
def stuff | |
@stuff_name | |
end | |
end | |
class Thing | |
def initalizer(*args) | |
@sharer = Sharer.new(*args) | |
end | |
def method_missing(meth, *args, &block) | |
@sharer.send(method, *args, &block) | |
end | |
def responds_to_missing(meth) | |
@sharer.responds_to(meth) | |
end | |
end | |
thing = Thing.new('my stuff') | |
puts thing.stuff | |
=> 'my stuff' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment