Sha256: f9df72ee7f37afd93f58f13e1eb61ca60c4e5403c49eec858409e0f635596806

Contents?: true

Size: 227 Bytes

Versions: 8

Compression:

Stored size: 227 Bytes

Contents

# frozen_string_literal: true

class ::Hash
  def symbolize_keys!
    replace symbolize_keys
  end

  def symbolize_keys
    each_with_object({}) { |(k, v), hsh| hsh[k.to_sym] = v.is_a?(Hash) ? v.symbolize_keys : v }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
marked-conductor-1.0.7 lib/conductor/hash.rb
marked-conductor-1.0.6 lib/conductor/hash.rb
marked-conductor-1.0.5 lib/conductor/hash.rb
marked-conductor-1.0.4 lib/conductor/hash.rb
marked-conductor-1.0.3 lib/conductor/hash.rb
marked-conductor-1.0.2 lib/conductor/hash.rb
marked-conductor-1.0.1 lib/conductor/hash.rb
marked-conductor-1.0.0 lib/conductor/hash.rb