Class: Zena::Use::ZafuSafeDefinitions::AParamsDictionary
- Inherits:
-
Object
- Object
- Zena::Use::ZafuSafeDefinitions::AParamsDictionary
- Includes:
- RubyLess
- Defined in:
- lib/zena/use/zafu_safe_definitions.rb
Overview
This class is used to return Array params [‘foo’, ‘bar’] as [‘foo’, ‘bar’], not ‘foobar’. It also splits String params ‘foo, bar’ as [‘foo’, ‘bar’].
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(params) ⇒ AParamsDictionary
constructor
A new instance of AParamsDictionary.
Constructor Details
#initialize(params) ⇒ AParamsDictionary
Returns a new instance of AParamsDictionary.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zena/use/zafu_safe_definitions.rb', line 13 def initialize(params) @aparams = {} params.each do |k, v| @aparams[k.to_sym] = transform(v) end def [](key) @aparams[key.to_sym] || [] end end |
Instance Method Details
#[](key) ⇒ Object
19 20 21 |
# File 'lib/zena/use/zafu_safe_definitions.rb', line 19 def [](key) @aparams[key.to_sym] || [] end |