Module: Convertator::Utils

Included in:
Converter
Defined in:
lib/convertator/utils.rb

Instance Method Summary collapse

Instance Method Details

#normalize_currency(currency) ⇒ Object



9
10
11
# File 'lib/convertator/utils.rb', line 9

def normalize_currency(currency)
  currency.to_sym.upcase
end

#symbolize_keys(array) ⇒ Object



3
4
5
6
7
# File 'lib/convertator/utils.rb', line 3

def symbolize_keys(array)
  array.each_with_object({}) do |(k, v), memo|
    memo[normalize_currency(k)] = v
  end
end