Sha256: 9dfdf66eb558dad48e64d69e421fd35afec4f42c5b94b3b43ecf1c366fdf7577

Contents?: true

Size: 247 Bytes

Versions: 17

Compression:

Stored size: 247 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.is_a?(Array)) ? v.symbolize_keys : v }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
marked-conductor-1.0.27 lib/conductor/hash.rb
marked-conductor-1.0.26 lib/conductor/hash.rb
marked-conductor-1.0.25 lib/conductor/hash.rb
marked-conductor-1.0.24 lib/conductor/hash.rb
marked-conductor-1.0.23 lib/conductor/hash.rb
marked-conductor-1.0.22 lib/conductor/hash.rb
marked-conductor-1.0.21 lib/conductor/hash.rb
marked-conductor-1.0.20 lib/conductor/hash.rb
marked-conductor-1.0.19 lib/conductor/hash.rb
marked-conductor-1.0.18 lib/conductor/hash.rb
marked-conductor-1.0.17 lib/conductor/hash.rb
marked-conductor-1.0.16 lib/conductor/hash.rb
marked-conductor-1.0.12 lib/conductor/hash.rb
marked-conductor-1.0.11 lib/conductor/hash.rb
marked-conductor-1.0.10 lib/conductor/hash.rb
marked-conductor-1.0.9 lib/conductor/hash.rb
marked-conductor-1.0.8 lib/conductor/hash.rb