Class: Game

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/mlb_gd2/game.rb

Constant Summary

Constants included from Helpers

Helpers::GD2_MLB_BASE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#boxscore, #build_base_url, #generate_nokogiri_html, #generate_nokogiri_xml, #valid_game?

Constructor Details

#initialize(url) ⇒ Game

Returns a new instance of Game.



12
13
14
15
16
# File 'lib/mlb_gd2/game.rb', line 12

def initialize(url)
  @url = url
  @home_team = Team.new(boxscore(url), "home")
  @away_team = Team.new(boxscore(url), "away")
end

Instance Attribute Details

#away_teamObject (readonly)

Returns the value of attribute away_team.



8
9
10
# File 'lib/mlb_gd2/game.rb', line 8

def away_team
  @away_team
end

#home_teamObject (readonly)

Returns the value of attribute home_team.



8
9
10
# File 'lib/mlb_gd2/game.rb', line 8

def home_team
  @home_team
end

#urlObject (readonly)

Returns the value of attribute url.



8
9
10
# File 'lib/mlb_gd2/game.rb', line 8

def url
  @url
end