Class: CleanParams::Configuration
- Inherits:
-
Object
- Object
- CleanParams::Configuration
- Defined in:
- lib/clean_params.rb
Instance Attribute Summary collapse
-
#controller_params ⇒ Object
Returns the value of attribute controller_params.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#extract_params ⇒ Object
for each rule in configuration file, check the params hash and sets instance variables.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
return nil if no rule for this attribute
62 63 64 |
# File 'lib/clean_params.rb', line 62 def method_missing(method, *args, &block) set_instances(method, method.to_s) end |
Instance Attribute Details
#controller_params ⇒ Object
Returns the value of attribute controller_params.
23 24 25 |
# File 'lib/clean_params.rb', line 23 def controller_params @controller_params end |
#params ⇒ Object
Returns the value of attribute params.
23 24 25 |
# File 'lib/clean_params.rb', line 23 def params @params end |
Instance Method Details
#extract_params ⇒ Object
for each rule in configuration file, check the params hash and sets instance variables
26 27 28 29 30 |
# File 'lib/clean_params.rb', line 26 def extract_params params.each do |key, val| set_instances(key, val) end end |