Class: ApiService::Action
- Inherits:
-
BaseAction
- Object
- BaseAction
- ApiService::Action
- Defined in:
- lib/api_service/action.rb
Instance Attribute Summary
Attributes inherited from BaseAction
Instance Method Summary collapse
-
#initialize(name, options, to_perform) ⇒ Action
constructor
A new instance of Action.
- #perform(params, state) ⇒ Object
Methods inherited from BaseAction
#abort_on_fail?, #fail_http_status
Constructor Details
#initialize(name, options, to_perform) ⇒ Action
Returns a new instance of Action.
5 6 7 8 |
# File 'lib/api_service/action.rb', line 5 def initialize(name, , to_perform) super(name, ) @to_perform = to_perform end |
Instance Method Details
#perform(params, state) ⇒ Object
10 11 12 |
# File 'lib/api_service/action.rb', line 10 def perform(params, state) @to_perform.call(params, state) end |