Class: Game
Class Method Summary collapse
-
.box_score(team, week) ⇒ Object
returns a box score for a particular team.
-
.box_scores(week) ⇒ Object
returns all box scores.
-
.final ⇒ Object
returns box scores for finishes games.
-
.in_progress ⇒ Object
returns box scores for games that are in progress.
Methods included from API::Request
base_url, build_url, headers, request_service
Class Method Details
permalink .box_score(team, week) ⇒ Object
returns a box score for a particular team
7 8 9 10 |
# File 'lib/game.rb', line 7 def self.box_score team, week data = request_service('BoxScore', [CoreExtensions::Fantasy::Date.regular_season, week, team])['Score'] # puts "#{data['AwayTeam']} vs. #{data['HomeTeam']}" end |
permalink .box_scores(week) ⇒ Object
returns all box scores
13 14 15 |
# File 'lib/game.rb', line 13 def self.box_scores week request_service('BoxScores', [CoreExtensions::Fantasy::Date.regular_season, week]) end |
permalink .final ⇒ Object
returns box scores for finishes games
24 25 26 27 |
# File 'lib/game.rb', line 24 def self.final final = request_service('FinalBoxScores') final.nil? ? final : "No finished games yet." end |
permalink .in_progress ⇒ Object
returns box scores for games that are in progress
18 19 20 21 |
# File 'lib/game.rb', line 18 def self.in_progress in_progress = request_service('ActiveBoxScores') in_progress.nil? ? in_progress : "No games in progress." end |