Sha256: 513f9b5518198aa854a41a2db670ce1fedeb24fd53d4c721cb39549a86b81599

Contents?: true

Size: 250 Bytes

Versions: 8

Compression:

Stored size: 250 Bytes

Contents

def indifferent_hash(json)
  parsed_json = JSON.parse(json)
  if parsed_json.respond_to?(:with_indifferent_access)
    parsed_json.with_indifferent_access
  elsif parsed_json.respond_to?(:map)
    parsed_json.map(&:with_indifferent_access)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
asyncapi-server-1.3.2 spec/support/indifferent_hash.rb
asyncapi-server-1.3.0 spec/support/indifferent_hash.rb
asyncapi-server-1.2.0 spec/support/indifferent_hash.rb
asyncapi-server-1.1.3 spec/support/indifferent_hash.rb
asyncapi-server-1.1.2 spec/support/indifferent_hash.rb
asyncapi-server-1.1.1 spec/support/indifferent_hash.rb
asyncapi-server-1.1.0 spec/support/indifferent_hash.rb
asyncapi-server-1.0.0 spec/support/indifferent_hash.rb