Class: ApiService::Action

Inherits:
BaseAction show all
Defined in:
lib/api_service/action.rb

Instance Attribute Summary

Attributes inherited from BaseAction

#options

Instance Method Summary collapse

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, options, to_perform)
  super(name, options)
  @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