Class: ConvenientService::Examples::Standard::RequestParams::Services::MergeParams

Inherits:
Object
  • Object
show all
Includes:
Service::Configs::Standard
Defined in:
lib/convenient_service/examples/standard/request_params/services/merge_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params_from_path:, params_from_body:) ⇒ MergeParams

Returns a new instance of MergeParams.



13
14
15
16
# File 'lib/convenient_service/examples/standard/request_params/services/merge_params.rb', line 13

def initialize(params_from_path:, params_from_body:)
  @params_from_path = params_from_path
  @params_from_body = params_from_body
end

Instance Attribute Details

#params_from_bodyObject (readonly)

Returns the value of attribute params_from_body.



11
12
13
# File 'lib/convenient_service/examples/standard/request_params/services/merge_params.rb', line 11

def params_from_body
  @params_from_body
end

#params_from_pathObject (readonly)

Returns the value of attribute params_from_path.



11
12
13
# File 'lib/convenient_service/examples/standard/request_params/services/merge_params.rb', line 11

def params_from_path
  @params_from_path
end

Instance Method Details

#resultObject



18
19
20
# File 'lib/convenient_service/examples/standard/request_params/services/merge_params.rb', line 18

def result
  success(params: params_from_path.merge(params_from_body))
end