Module: JSON

Defined in:
lib/jinx/json/deserializer.rb

Class Method Summary collapse

Class Method Details

.parse(source, opts = {}) ⇒ Object

Bumps the default JSON nesting level to 100.



5
6
7
8
9
10
11
12
13
# File 'lib/jinx/json/deserializer.rb', line 5

def self.parse(source, opts={})
  visited = Thread.current[:jinx_json_deserialized] ||= {}
  opts = opts.merge(:max_nesting => 100) unless opts.has_key?(:max_nesting) 
  begin
    Parser.new(source, opts).parse
  ensure
    visited.clear
  end
end