Class: Xmlstats::Endpoints::NbaStanding
- Inherits:
-
Object
- Object
- Xmlstats::Endpoints::NbaStanding
- Includes:
- Xmlstats::Endpoint
- Defined in:
- lib/xmlstats/endpoints/nba_standing.rb
Class Method Summary collapse
Methods included from Xmlstats::Endpoint
Class Method Details
.fetch(date = Date.today) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/xmlstats/endpoints/nba_standing.rb', line 5 def self.fetch(date = Date.today) date_str = date.strftime("%Y%m%d") unless date.kind_of? String response = fetch_json("nba/standings/#{date_str}") standing = response["standing"] standing.map do |team_standing| Xmlstats::Objects::Standing.new team_standing.merge(date: date) end end |