Class: ConvenientService::Examples::Standard::V1::RequestParams::Services::FilterOutUnpermittedParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params:, permitted_keys:) ⇒ FilterOutUnpermittedParams

Returns a new instance of FilterOutUnpermittedParams.



14
15
16
17
# File 'lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb', line 14

def initialize(params:, permitted_keys:)
  @params = params
  @permitted_keys = permitted_keys
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



12
13
14
# File 'lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb', line 12

def params
  @params
end

#permitted_keysObject (readonly)

Returns the value of attribute permitted_keys.



12
13
14
# File 'lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb', line 12

def permitted_keys
  @permitted_keys
end

Instance Method Details

#resultObject



19
20
21
# File 'lib/convenient_service/examples/standard/v1/request_params/services/filter_out_unpermitted_params.rb', line 19

def result
  success(params: params.slice(*permitted_keys))
end