Sha256: 65dd59fbaf77c8500da0ef1e2247fd772a9d8ddc19ea8168649d3ffd52dab107

Contents?: true

Size: 341 Bytes

Versions: 64

Compression:

Stored size: 341 Bytes

Contents

class Hash
  def recursive_symbolize_keys!
    symbolize_keys!
    # symbolize each hash in .values
    values.each{|h| h.recursive_symbolize_keys! if h.is_a?(Hash) }
    # symbolize each hash inside an array in .values
    values.select{|v| v.is_a?(Array) }.flatten.each{|h| h.recursive_symbolize_keys! if h.is_a?(Hash) }
    self
  end
end

Version data entries

64 entries across 64 versions & 3 rubygems

Version Path
gotransverse-tract-api-0.24.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.23.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.22.1 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.22.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.21.1 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.21.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.20.3 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.20.2 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.20.1 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.20.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.19.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.18.3 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.18.2 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.18.1 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.18.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.17.2 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.17.1 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.17.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.16.0 lib/gotransverse-tract-api/hash.rb
gotransverse-tract-api-0.15.0 lib/gotransverse-tract-api/hash.rb