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.5.1 lib/volt/extra_core/stringify_keys.rb
volt-0.5.0 lib/volt/extra_core/stringify_keys.rb
volt-0.4.18 lib/volt/extra_core/stringify_keys.rb
volt-0.4.17 lib/volt/extra_core/stringify_keys.rb
volt-0.4.15 lib/volt/extra_core/stringify_keys.rb
volt-0.4.14 lib/volt/extra_core/stringify_keys.rb
volt-0.4.12 lib/volt/extra_core/stringify_keys.rb
volt-0.4.11 lib/volt/extra_core/stringify_keys.rb
volt-0.4.10 lib/volt/extra_core/stringify_keys.rb
volt-0.4.9 lib/volt/extra_core/stringify_keys.rb
volt-0.4.8 lib/volt/extra_core/stringify_keys.rb
volt-0.4.7 lib/volt/extra_core/stringify_keys.rb
volt-0.4.5 lib/volt/extra_core/stringify_keys.rb
volt-0.4.4 lib/volt/extra_core/stringify_keys.rb
volt-0.4.3 lib/volt/extra_core/stringify_keys.rb
volt-0.4.2 lib/volt/extra_core/stringify_keys.rb
volt-0.4.1 lib/volt/extra_core/stringify_keys.rb