Class: Xmlstats::Endpoints::NbaBoxScore

Inherits:
Object
  • Object
show all
Includes:
Xmlstats::Endpoint
Defined in:
lib/xmlstats/endpoints/nba_box_score.rb

Class Method Summary collapse

Methods included from Xmlstats::Endpoint

included

Class Method Details

.fetch(event_id = nil) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/xmlstats/endpoints/nba_box_score.rb', line 5

def self.fetch(event_id = nil)
  raise "please specify event_id as detailed in https://erikberg.com/api#boxscore" unless event_id

  response = fetch_json("nba/boxscore/#{event_id}")

  Xmlstats::Objects::NbaBoxScore.new response.merge(event_id: event_id)
end