Sha256: 49cb058398db4223693e9a0ea760701cabe3cb423b95dd7622ba777c16cabee4

Contents?: true

Size: 249 Bytes

Versions: 77

Compression:

Stored size: 249 Bytes

Contents

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

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

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
volt-0.7.18 lib/volt/extra_core/stringify_keys.rb
volt-0.7.17 lib/volt/extra_core/stringify_keys.rb
volt-0.7.16 lib/volt/extra_core/stringify_keys.rb
volt-0.7.15 lib/volt/extra_core/stringify_keys.rb
volt-0.7.14 lib/volt/extra_core/stringify_keys.rb
volt-0.7.13 lib/volt/extra_core/stringify_keys.rb
volt-0.7.12 lib/volt/extra_core/stringify_keys.rb
volt-0.7.10 lib/volt/extra_core/stringify_keys.rb
volt-0.7.9 lib/volt/extra_core/stringify_keys.rb
volt-0.7.8 lib/volt/extra_core/stringify_keys.rb
volt-0.7.7 lib/volt/extra_core/stringify_keys.rb
volt-0.7.6 lib/volt/extra_core/stringify_keys.rb
volt-0.7.5 lib/volt/extra_core/stringify_keys.rb
volt-0.7.4 lib/volt/extra_core/stringify_keys.rb
volt-0.7.3 lib/volt/extra_core/stringify_keys.rb
volt-0.7.2 lib/volt/extra_core/stringify_keys.rb
volt-0.7.1 lib/volt/extra_core/stringify_keys.rb
volt-0.7.0 lib/volt/extra_core/stringify_keys.rb
volt-0.6.5 lib/volt/extra_core/stringify_keys.rb
volt-0.6.4 lib/volt/extra_core/stringify_keys.rb