Class: QuestradeApi::REST::OptionQuote
- Defined in:
- lib/questrade_api/rest/option_quote.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
#account_id, #authorization, #connection, #data, #endpoint, #id, #raw_body
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ OptionQuote
constructor
A new instance of OptionQuote.
Methods inherited from Base
#build_attributes, #build_data, connection, #fetch, post, #url
Constructor Details
#initialize(params) ⇒ OptionQuote
Returns a new instance of OptionQuote.
6 7 8 9 |
# File 'lib/questrade_api/rest/option_quote.rb', line 6 def initialize(params) @raw_body = params[:data] build_data(params[:data]) if @raw_body end |
Class Method Details
.endpoint ⇒ Object
26 27 28 |
# File 'lib/questrade_api/rest/option_quote.rb', line 26 def self.endpoint "#{BASE_ENDPOINT}/markets/quotes/options" end |
.fetch(authorization, params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/questrade_api/rest/option_quote.rb', line 11 def self.fetch(, params) response = post(access_token: .access_token, endpoint: endpoint, url: .url, body: params.to_json) if response.status == 200 result = OpenStruct.new(optionQuotes: []) result.optionQuotes = parse_option_quotes(response.body) response = result end response end |