Module: OandaAPI::Streaming::Adapters::Gson
Overview
Can be used if the ruby engine (RUBY_ENGINE
) is jruby. Uses the gson 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/gson.rb', line 15 def parse(string) string.strip! return [] if string.empty? [parser.decode(string)].flatten end |