Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Wrapping multiple objects in ruby
# Multiplexer - multiple objects wrapped in one object
# written by Jared Grippe jared@change.org
class Multiplexer
instance_methods.each { |m| undef_method m unless m =~ /^__/ }
def initialize *objects
@__objects__ = objects
end
def method_missing(sym, *args, &block)
@__objects__.map{|io| io.__send__(sym, *args, &block) }.first
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.