Class: Polygonio::Rest::Reference::Markets

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

Defined Under Namespace

Classes: MarketHolidaysResponse, MarketStatusResponse, MarketsResponse

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

#holidaysObject



48
49
50
51
# File 'lib/polygonio/rest/api/reference/markets.rb', line 48

def holidays
  res = client.request.get("/v1/marketstatus/upcoming")
  Types::Array.of(MarketHolidaysResponse)[res.body]
end

#listObject



15
16
17
18
# File 'lib/polygonio/rest/api/reference/markets.rb', line 15

def list
  res = client.request.get("/v2/reference/markets")
  MarketsResponse[res.body]
end

#statusObject



34
35
36
37
# File 'lib/polygonio/rest/api/reference/markets.rb', line 34

def status
  res = client.request.get("/v1/marketstatus/now")
  MarketStatusResponse[res.body]
end