Class: ConvenientService::Examples::Standard::V1::RequestParams::Services::FilterOutUnpermittedParams
- Inherits:
-
Object
- Object
- ConvenientService::Examples::Standard::V1::RequestParams::Services::FilterOutUnpermittedParams
- 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
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#permitted_keys ⇒ Object
readonly
Returns the value of attribute permitted_keys.
Instance Method Summary collapse
-
#initialize(params:, permitted_keys:) ⇒ FilterOutUnpermittedParams
constructor
A new instance of FilterOutUnpermittedParams.
- #result ⇒ Object
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
#params ⇒ Object (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_keys ⇒ Object (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
#result ⇒ Object
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 |