Class: Plucky::Normalizers::HashKey
- Defined in:
- lib/plucky/normalizers/hash_key.rb
Instance Method Summary collapse
-
#call(key) ⇒ Object
Public: Normalizes an options hash key.
-
#initialize(keys) ⇒ HashKey
constructor
A new instance of HashKey.
Constructor Details
#initialize(keys) ⇒ HashKey
Returns a new instance of HashKey.
5 6 7 |
# File 'lib/plucky/normalizers/hash_key.rb', line 5 def initialize(keys) @keys = keys end |
Instance Method Details
#call(key) ⇒ Object
Public: Normalizes an options hash key
key - The key to normalize
Returns a Symbol.
14 15 16 |
# File 'lib/plucky/normalizers/hash_key.rb', line 14 def call(key) @keys.fetch key.to_sym, key end |