Class: Polygonio::Rest::Reference::Stocks

Inherits:
PolygonRestHandler show all
Defined in:
lib/polygonio/rest/api/reference/stocks.rb

Defined Under Namespace

Classes: StockDividendsResponse, StockFinancialsParameters, StockFinancialsResponse, StockSplitsResponse

Instance Attribute Summary

Attributes inherited from PolygonRestHandler

#client

Instance Method Summary collapse

Methods inherited from PolygonRestHandler

#initialize

Constructor Details

This class inherits a constructor from Polygonio::Rest::PolygonRestHandler

Instance Method Details

#dividends(symbol) ⇒ Object



43
44
45
46
# File 'lib/polygonio/rest/api/reference/stocks.rb', line 43

def dividends(symbol)
  res = client.request.get("/v2/reference/dividends/#{symbol}")
  StockDividendsResponse[res.body]
end

#financials(symbol, params = {}) ⇒ Object



61
62
63
64
65
66
# File 'lib/polygonio/rest/api/reference/stocks.rb', line 61

def financials(symbol, params = {})
  params = StockFinancialsParameters[params]

  res = client.request.get("/v2/reference/financials/#{symbol}", params.to_h)
  StockFinancialsResponse[res.body]
end

#splits(symbol) ⇒ Object



22
23
24
25
# File 'lib/polygonio/rest/api/reference/stocks.rb', line 22

def splits(symbol)
  res = client.request.get("/v2/reference/splits/#{symbol}")
  StockSplitsResponse[res.body]
end