Module: OandaAPI::Streaming::Adapters::Yajl
Overview
Can be used if the ruby engine (RUBY_ENGINE
) is NOT jruby. Uses the yajl-ruby gem.
Handles streams of multiple JSON objects that may or may not be delimited with whitespace.
Instance Method Summary collapse
-
#parse(string) ⇒ Array<Hash>
Deserializes a stream of JSON objects.
Instance Method Details
#parse(string) ⇒ Array<Hash>
Deserializes a stream of JSON objects.
15 16 17 18 19 |
# File 'lib/oanda_api/streaming/adapters/yajl.rb', line 15 def parse(string) results = [] parser.parse(string) { |hash| results << hash } results end |