module Quebert::Support

Public Class Methods

stringify_keys(hash) click to toggle source
# File lib/quebert/support.rb, line 23
def self.stringify_keys(hash)
  map_keys(hash, :to_s)
end
symbolize_keys(hash) click to toggle source
# File lib/quebert/support.rb, line 19
def self.symbolize_keys(hash)
  map_keys(hash, :to_sym)
end

Private Class Methods

map_keys(hash, meth) click to toggle source
# File lib/quebert/support.rb, line 28
def self.map_keys(hash, meth)
  hash.inject({}){|h, (k,v)| h[k.send(meth)] = v; h; }
end