Module: Nuggets::JSON::MultiMixin

Defined in:
lib/nuggets/json/multi_mixin.rb

Defined Under Namespace

Classes: MULTI_KEY, MULTI_OBJECT

Instance Method Summary collapse

Instance Method Details

#parse_multi(source, opts = {}) ⇒ Object

Preserves multiple (non-unique) names in "non-interoperable" JSON objects.



33
34
35
# File 'lib/nuggets/json/multi_mixin.rb', line 33

def parse_multi(source, opts = {})
  parse(source, opts.merge(object_class: MULTI_OBJECT))
end

#pretty_print_multi(source, opts = {}) ⇒ Object Also known as: pp



37
38
39
# File 'lib/nuggets/json/multi_mixin.rb', line 37

def pretty_print_multi(source, opts = {})
  pretty_generate(parse_multi(source, opts), opts)
end