Class: Invoca::Utils::MultiSender
- Inherits:
-
Object
- Object
- Invoca::Utils::MultiSender
- Defined in:
- lib/invoca/utils/multi_sender.rb
Instance Method Summary collapse
-
#initialize(enumerable, method) ⇒ MultiSender
constructor
A new instance of MultiSender.
-
#method_missing(name, *args, &block) ⇒ Object
rubocop:disable Style/MethodMissingSuper rubocop:disable Style/MissingRespondToMissing.
Constructor Details
#initialize(enumerable, method) ⇒ MultiSender
Returns a new instance of MultiSender.
8 9 10 11 |
# File 'lib/invoca/utils/multi_sender.rb', line 8 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
rubocop:disable Style/MethodMissingSuper rubocop:disable Style/MissingRespondToMissing
15 16 17 |
# File 'lib/invoca/utils/multi_sender.rb', line 15 def method_missing(name, *args, &block) @enumerable.send(@method) { |x| x.send(name, *args, &block) } end |