class DuplicateKeyChecker

scr: stackoverflow.com/questions/18808031/parsing-a-json-string-with-duplicate-keys-in-ruby

Attributes

keys[R]

Public Instance Methods

[]=(key, _value) click to toggle source
# File lib/extend_json.rb, line 5
def []=(key, _value)
  @keys ||= []
  if @keys.include?(key)
    @@double_keys << {key: key, value: _value}
  else
    @keys << key
  end
end
get_duplicates() click to toggle source
# File lib/extend_json.rb, line 14
def get_duplicates
  return @@double_keys
end