Module: Pact::SymbolizeKeys

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
# File 'lib/pact/symbolize_keys.rb', line 4

def self.included(base)
  base.extend(self)
end

Instance Method Details

#symbolize_keys(hash) ⇒ Object



8
9
10
11
# File 'lib/pact/symbolize_keys.rb', line 8

def symbolize_keys hash
  return nil if hash.nil?
  hash.inject({}) { |memo, (k,v)| memo[k.to_sym] = v; memo }
end