Class: WindUp::Delegator
- Inherits:
-
Object
- Object
- WindUp::Delegator
- Includes:
- Celluloid
- Defined in:
- lib/wind_up/delegator.rb
Instance Method Summary collapse
-
#perform_with(delegatee, *args) ⇒ Object
Instantiate the referenced class and run the #perform action.
Instance Method Details
#perform_with(delegatee, *args) ⇒ Object
Instantiate the referenced class and run the #perform action
44 45 46 47 48 |
# File 'lib/wind_up/delegator.rb', line 44 def perform_with(delegatee, *args) handler = delegatee.new raise InvalidDelegatee, "#{delegatee} does not have a #perform method defined" unless handler.respond_to?(:perform) handler.perform *args end |