Module: Services::ReturnServiceResponses

Included in:
Ci::PipelineTriggerService, Import::GitlabProjects::CreateProjectService, WorkItems::CreateService
Defined in:
app/services/concerns/services/return_service_responses.rb

Overview

adapter for existing services over BaseServiceUtility - add error and success methods returning ServiceResponse objects

Instance Method Summary collapse

Instance Method Details

#error(message, http_status, pass_back: {}) ⇒ Object


7
8
9
# File 'app/services/concerns/services/return_service_responses.rb', line 7

def error(message, http_status, pass_back: {})
  ServiceResponse.error(message: message, http_status: http_status, payload: pass_back)
end

#success(payload) ⇒ Object


11
12
13
# File 'app/services/concerns/services/return_service_responses.rb', line 11

def success(payload)
  ServiceResponse.success(payload: payload)
end