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.6.3 lib/volt/extra_core/stringify_keys.rb
volt-0.6.2 lib/volt/extra_core/stringify_keys.rb
volt-0.6.1 lib/volt/extra_core/stringify_keys.rb
volt-0.6.0 lib/volt/extra_core/stringify_keys.rb
volt-0.5.18 lib/volt/extra_core/stringify_keys.rb
volt-0.5.17 lib/volt/extra_core/stringify_keys.rb
volt-0.5.16 lib/volt/extra_core/stringify_keys.rb
volt-0.5.15 lib/volt/extra_core/stringify_keys.rb
volt-0.5.14 lib/volt/extra_core/stringify_keys.rb
volt-0.5.13 lib/volt/extra_core/stringify_keys.rb
volt-0.5.12 lib/volt/extra_core/stringify_keys.rb
volt-0.5.11 lib/volt/extra_core/stringify_keys.rb
volt-0.5.10 lib/volt/extra_core/stringify_keys.rb
volt-0.5.9 lib/volt/extra_core/stringify_keys.rb
volt-0.5.8 lib/volt/extra_core/stringify_keys.rb
volt-0.5.7 lib/volt/extra_core/stringify_keys.rb
volt-0.5.6 lib/volt/extra_core/stringify_keys.rb
volt-0.5.4 lib/volt/extra_core/stringify_keys.rb
volt-0.5.3 lib/volt/extra_core/stringify_keys.rb
volt-0.5.2 lib/volt/extra_core/stringify_keys.rb