lib/jsonify/builder.rb in jsonify-0.0.8 vs lib/jsonify/builder.rb in jsonify-0.0.9
- old
+ new
@@ -33,10 +33,10 @@
# This method can be called without any side effects. You can call +compile!+ at any time, and multiple times if desired.
#
# @raise [TypeError] only if +:verify+ is set to true
# @raise [JSON::ParseError] only if +:verify+ is set to true
def compile!
- result = (@stack[0] ? @stack[0].evaluate : {}.to_json)
+ result = (@stack[0] || {}).to_json
JSON.parse(result) if @verify
@pretty ? JSON.pretty_generate(JSON.parse(result)) : result
end
# Stores the key and value into a JSON object
\ No newline at end of file