Class: IknowParams::Parser::HashParser
- Inherits:
-
Object
- Object
- IknowParams::Parser::HashParser
- Includes:
- IknowParams::Parser
- Defined in:
- lib/iknow_params/parser/hash_parser.rb
Overview
Simple wrapper to use IknowParams::Parser to extract and verify content from an arbitrary hash
Constant Summary
Constants included from IknowParams::Parser
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(view_hash) ⇒ HashParser
constructor
A new instance of HashParser.
- #parse(&block) ⇒ Object
Methods included from IknowParams::Parser
#parse_array_param, parse_hash, #parse_param, parse_value, parse_values, register_serializer, #remove_blanks
Constructor Details
#initialize(view_hash) ⇒ HashParser
Returns a new instance of HashParser.
12 13 14 |
# File 'lib/iknow_params/parser/hash_parser.rb', line 12 def initialize(view_hash) @params = ActiveSupport::HashWithIndifferentAccess.new(view_hash) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/iknow_params/parser/hash_parser.rb', line 10 def params @params end |
Instance Method Details
#parse(&block) ⇒ Object
16 17 18 |
# File 'lib/iknow_params/parser/hash_parser.rb', line 16 def parse(&block) instance_exec(&block) end |