Sha256: 3c93478e9c643bef80dd49b8269f27725bc8f63a0acd835cc51e5d17fed4b7f9

Contents?: true

Size: 249 Bytes

Versions: 1

Compression:

Stored size: 249 Bytes

Contents

class Hash
  def symbolize_keys
    self.each_with_object({}){|(k,v),memo| memo[k.to_s.to_sym]=v}
  end
  def deep_symbolize_keys
    self.each_with_object({}){|(k,v),memo| memo[k.to_s.to_sym]=(v.is_a?(Hash) ? v.deep_symbolize_keys : v)}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
methan-0.1.0 lib/methan/util.rb