Class: MarkMapper::Normalizers::HashKey

Inherits:
Object
  • Object
show all
Defined in:
lib/mark_mapper/normalizers/hash_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(keys) ⇒ HashKey

Returns a new instance of HashKey.


5
6
7
# File 'lib/mark_mapper/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/mark_mapper/normalizers/hash_key.rb', line 14

def call(key)
  @keys.fetch key.to_sym, key
end