Class: ActionParamsPermitter::PermitProcessor
- Inherits:
-
Object
- Object
- ActionParamsPermitter::PermitProcessor
- Defined in:
- lib/action_params_permitter/permit_processor.rb
Overview
Makes permitting process. It can be done using income params from your controller and builded permitter
Parameters: params - instance of ActionController::Parameters builder - instance of Builders::Main
Returns: hash with permitted parameters
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params, builder) ⇒ PermitProcessor
constructor
A new instance of PermitProcessor.
Constructor Details
#initialize(params, builder) ⇒ PermitProcessor
Returns a new instance of PermitProcessor.
21 22 23 |
# File 'lib/action_params_permitter/permit_processor.rb', line 21 def initialize(params, builder) @params, @builder = params, builder end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
17 18 19 |
# File 'lib/action_params_permitter/permit_processor.rb', line 17 def builder @builder end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
17 18 19 |
# File 'lib/action_params_permitter/permit_processor.rb', line 17 def params @params end |
Instance Method Details
#call ⇒ Object
25 26 27 |
# File 'lib/action_params_permitter/permit_processor.rb', line 25 def call top_is_required? ? make_requiring : make_permitting end |