Sha256: a02cbec008b0764b2a1641424fbbc9d5b7d034f56cfc556dd558c11a6f229aa2

Contents?: true

Size: 246 Bytes

Versions: 71

Compression:

Stored size: 246 Bytes

Contents

class Object
  def stringify_keys
    each_with_object({}) do |(key, value), hash|
      hash[key.to_s] = value
    end
  end

  def symbolize_keys
    each_with_object({}) do |(key, value), hash|
      hash[key.to_sym] = value
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
volt-0.9.7.pre8 lib/volt/extra_core/stringify_keys.rb
volt-0.9.7.pre7 lib/volt/extra_core/stringify_keys.rb
volt-0.9.7.pre6 lib/volt/extra_core/stringify_keys.rb
volt-0.9.7.pre5 lib/volt/extra_core/stringify_keys.rb
volt-0.9.7.pre3 lib/volt/extra_core/stringify_keys.rb
volt-0.9.7.pre2 lib/volt/extra_core/stringify_keys.rb
volt-0.9.6 lib/volt/extra_core/stringify_keys.rb
volt-0.9.6.pre3 lib/volt/extra_core/stringify_keys.rb
volt-0.9.6.pre2 lib/volt/extra_core/stringify_keys.rb
volt-0.9.6.pre1 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre12 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre11 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre9 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre8 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre7 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre6 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre5 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre4 lib/volt/extra_core/stringify_keys.rb
volt-0.9.5.pre3 lib/volt/extra_core/stringify_keys.rb