Class: ConvenientService::Examples::Standard::RequestParams::Services::FilterOutUnpermittedParams
- Inherits:
-
Object
- Object
- ConvenientService::Examples::Standard::RequestParams::Services::FilterOutUnpermittedParams
- Includes:
- Service::Configs::Standard
- Defined in:
- lib/convenient_service/examples/standard/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.
13 14 15 16 |
# File 'lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb', line 13 def initialize(params:, permitted_keys:) @params = params @permitted_keys = permitted_keys end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
11 12 13 |
# File 'lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb', line 11 def params @params end |
#permitted_keys ⇒ Object (readonly)
Returns the value of attribute permitted_keys.
11 12 13 |
# File 'lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb', line 11 def permitted_keys @permitted_keys end |
Instance Method Details
#result ⇒ Object
18 19 20 |
# File 'lib/convenient_service/examples/standard/request_params/services/filter_out_unpermitted_params.rb', line 18 def result success(params: params.slice(*permitted_keys)) end |