Module: Controller::ServiceActionsConcern

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/controller/service_actions_concern.rb

Instance Method Summary collapse

Instance Method Details

#callObject



18
19
20
21
22
23
24
25
26
# File 'app/controllers/concerns/controller/service_actions_concern.rb', line 18

def call
  @service = prepare_service
  @response = @service.do_work
  if @response.success?
    render :success
  else
    render :invoke
  end
end

#indexObject



10
11
# File 'app/controllers/concerns/controller/service_actions_concern.rb', line 10

def index
end

#invokeObject



13
14
15
16
# File 'app/controllers/concerns/controller/service_actions_concern.rb', line 13

def invoke
  @service = initialize_service
  respond_with @service
end