class DataStream::Api
Attributes
session[R]
Public Class Methods
new()
click to toggle source
# File lib/data_stream_api.rb, line 81 def initialize @session = Session.new end
Public Instance Methods
isin_stream(isin, date_start, date_end, options={})
click to toggle source
# File lib/data_stream_api.rb, line 114 def isin_stream(isin, date_start, date_end, options={}) stream isin, date_start, date_end, options end
ric_stream(ric, date_start, date_end, options={})
click to toggle source
# File lib/data_stream_api.rb, line 110 def ric_stream(ric, date_start, date_end, options={}) stream "<#{ric}>", date_start, date_end, options end
stream(value, date_start, date_end, options={})
click to toggle source
# File lib/data_stream_api.rb, line 85 def stream(value, date_start, date_end, options={}) date = { "End" => date_end, "Frequency" => "", "Kind" => 1, "Start" => date_start } instrument = { "Properties" => [ { "Key" => "IsSymbolSet", "Value" => true } ], "Value" => value } stream = Stream.new @session, instrument, date stream.result["DataResponse"]["Dates"].each_with_index.map do |date, i| { date: parseDate(date, options), value: stream.result["DataResponse"]["DataTypeValues"][0]["SymbolValues"][0]["Value"][i] } end end