Sha256: 2ee2aa43067b2b6aac24c84e1ca16b2d8ffb68fbdc300b5abb639fa3393649b2

Contents?: true

Size: 342 Bytes

Versions: 1

Compression:

Stored size: 342 Bytes

Contents

#
# Symbolize Keys functionality
#
class Hash
  def symbolize_keys
    inject({}) do |result, (key, v)|
      key = key.to_sym rescue key

      if v.is_a?(Hash)
        result[key] = v.symbolize_keys
      else
        result[key] = v
      end

      result
    end
  end

  def symbolize_keys!
    self.replace symbolize_keys
  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rodeo_clown-0.1.0 lib/rodeo_clown/ext/hash.rb