Class: Enumerable::MultiSender

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

Instance Method Summary collapse

Constructor Details

#initialize(enumerable, method) ⇒ MultiSender

Returns a new instance of MultiSender.



40
41
42
43
# File 'lib/hobo_support/enumerable.rb', line 40

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



45
46
47
# File 'lib/hobo_support/enumerable.rb', line 45

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