Module: Muve::Helper

Included in:
Model, Store, Store::Formatter
Defined in:
lib/muve/helpers.rb

Class Method Summary collapse

Class Method Details

.symbolize_keys(hash = {}) ⇒ Object

Raises:

  • (ArgumentError)


3
4
5
6
# File 'lib/muve/helpers.rb', line 3

def self.symbolize_keys(hash = {})
  raise ArgumentError.new("argument must be a Hash but was a #{hash.class} #{hash}") unless hash.kind_of? Hash
  hash.map { |k, v| { k.to_sym => v } }.inject(&:merge)
end