Module: ServiceObjects::Helpers::Parameterized
Overview
Note:
A target class should be extended by the module
Features for service parameters declaration
Instance Method Summary collapse
-
#allows_params(*list) ⇒ Array<Symbol>
Whitelists new options assigned to params.
Methods included from Parameters
Instance Method Details
#allows_params(*list) ⇒ Array<Symbol>
Whitelists new options assigned to params
Mutates the current class by adding the corresponding attribute for every parameter.
49 50 51 52 53 54 |
# File 'lib/service_objects/helpers/parameterized.rb', line 49 def allows_params(*list) @whitelist = list.flatten.map(&:to_sym).freeze __attr_params__ whitelist end |