Class: Enumerable::MultiSender

Inherits:
Object
  • Object
show all
Defined in:
lib/hobosupport/enumerable.rb

Instance Method Summary collapse

Constructor Details

#initialize(enumerable, method) ⇒ MultiSender

Returns a new instance of MultiSender.



43
44
45
46
# File 'lib/hobosupport/enumerable.rb', line 43

def initialize(enumerable, method)
  @enumerable = enumerable
  @method     = method
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



48
49
50
# File 'lib/hobosupport/enumerable.rb', line 48

def method_missing(name, *args, &block)
  @enumerable.send(@method) { |x| x.send(name, *args, &block) }
end