Class: Flappy::MultiIO::MultiDelegator
- Defined in:
- lib/flappy/util/multi_io.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*targets) ⇒ MultiDelegator
constructor
A new instance of MultiDelegator.
Constructor Details
#initialize(*targets) ⇒ MultiDelegator
Returns a new instance of MultiDelegator.
7 8 9 |
# File 'lib/flappy/util/multi_io.rb', line 7 def initialize(*targets) @targets = targets end |
Class Method Details
.delegate(*methods) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/flappy/util/multi_io.rb', line 11 def self.delegate(*methods) methods.each do |m| define_method(m) do |*args| @targets.map { |t| t.send(m, *args) } end end self end |