Class: Brapi::Resources::Quote

Inherits:
Brapi::Resource show all
Includes:
Paginated
Defined in:
lib/brapi/resources/quote.rb

Constant Summary

Constants included from Paginated

Paginated::DEFAULT_MAX_PAGES

Instance Attribute Summary

Attributes inherited from Brapi::Resource

#client

Instance Method Summary collapse

Methods included from Paginated

included

Methods inherited from Brapi::Resource

#initialize

Constructor Details

This class inherits a constructor from Brapi::Resource

Instance Method Details

#list(**params) ⇒ Object

GET /api/quote/list



25
26
27
28
# File 'lib/brapi/resources/quote.rb', line 25

def list(**params)
  raw = get("/api/quote/list", params: params)
  Brapi::Models::QuoteListResponse.from_h(raw)
end

#retrieve(tickers, **params) ⇒ Object

GET /api/quote/tickers



18
19
20
21
22
# File 'lib/brapi/resources/quote.rb', line 18

def retrieve(tickers, **params)
  tickers_str = Array(tickers).join(",")
  raw = get("/api/quote/#{CGI.escape(tickers_str)}", params: params)
  Brapi::Models::QuoteRetrieveResponse.from_h(raw)
end