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.8.15 lib/volt/extra_core/stringify_keys.rb
volt-0.8.14 lib/volt/extra_core/stringify_keys.rb
volt-0.8.13 lib/volt/extra_core/stringify_keys.rb
volt-0.8.11 lib/volt/extra_core/stringify_keys.rb
volt-0.8.10 lib/volt/extra_core/stringify_keys.rb
volt-0.8.9 lib/volt/extra_core/stringify_keys.rb
volt-0.8.8 lib/volt/extra_core/stringify_keys.rb
volt-0.8.7 lib/volt/extra_core/stringify_keys.rb
volt-0.8.6 lib/volt/extra_core/stringify_keys.rb
volt-0.8.5 lib/volt/extra_core/stringify_keys.rb
volt-0.8.4 lib/volt/extra_core/stringify_keys.rb
volt-0.8.3 lib/volt/extra_core/stringify_keys.rb
volt-0.8.2 lib/volt/extra_core/stringify_keys.rb
volt-0.8.1 lib/volt/extra_core/stringify_keys.rb
volt-0.8.0 lib/volt/extra_core/stringify_keys.rb
volt-0.7.23 lib/volt/extra_core/stringify_keys.rb
volt-0.7.22 lib/volt/extra_core/stringify_keys.rb
volt-0.7.21 lib/volt/extra_core/stringify_keys.rb
volt-0.7.20 lib/volt/extra_core/stringify_keys.rb
volt-0.7.19 lib/volt/extra_core/stringify_keys.rb