lib/json/streamer/json_streamer.rb in json-streamer-1.1.2 vs lib/json/streamer/json_streamer.rb in json-streamer-1.2.0

- old
+ new

@@ -20,11 +20,15 @@ @parser.start_object {start_object} @parser.start_array {start_array} @parser.key {|k| key(k)} end + def <<(data) + @parser << data + end + # Callbacks containing `yield` have to be defined in the method called via block otherwise yield won't work - def get(nesting_level:-1, key:nil, yield_values:true) + def get(nesting_level: -1, key: nil, yield_values: true) @yield_level = nesting_level @yield_key = key @yield_values = yield_values @parser.value do |v|