Class: DataStream::Stream
- Inherits:
-
Object
- Object
- DataStream::Stream
- Includes:
- HTTParty
- Defined in:
- lib/data_stream_api.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(session, instrument, date) ⇒ Stream
constructor
A new instance of Stream.
Constructor Details
#initialize(session, instrument, date) ⇒ Stream
Returns a new instance of Stream.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/data_stream_api.rb', line 50 def initialize(session, instrument, date) @session = session path = "/DswsClient/V1/DSService.svc/rest/GetData" = { headers: { "Content-Type" => "application/json" }, body: { "DataRequest" => { "Date" => date, "Instrument" => instrument, "Tag" => nil }, "Properties" => nil, "TokenValue" => @session.token }.to_json } if session.configured? @result = self.class.post path, @session.logger.debug @result else session.not_configured_error end end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
48 49 50 |
# File 'lib/data_stream_api.rb', line 48 def result @result end |