Class: Gameday::GameInfo
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Gameday::GameInfo
- Defined in:
- lib/gameday/game_info.rb
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #first_base_ump ⇒ Object
- #home_plate_ump ⇒ Object
-
#initialize(game_info_xml) ⇒ GameInfo
constructor
A new instance of GameInfo.
- #second_base_ump ⇒ Object
- #third_base_ump ⇒ Object
- #ump(pos) ⇒ Object
Constructor Details
#initialize(game_info_xml) ⇒ GameInfo
Returns a new instance of GameInfo.
10 11 12 |
# File 'lib/gameday/game_info.rb', line 10 def initialize(game_info_xml) @xml = Nokogiri.HTML(game_info_xml) end |
Instance Method Details
#__getobj__ ⇒ Object
6 7 8 |
# File 'lib/gameday/game_info.rb', line 6 def __getobj__ @xml end |
#first_base_ump ⇒ Object
14 15 16 |
# File 'lib/gameday/game_info.rb', line 14 def first_base_ump ump("1B") end |
#home_plate_ump ⇒ Object
23 24 25 |
# File 'lib/gameday/game_info.rb', line 23 def home_plate_ump ump("HP") end |
#second_base_ump ⇒ Object
17 18 19 |
# File 'lib/gameday/game_info.rb', line 17 def second_base_ump ump("2B") end |
#third_base_ump ⇒ Object
20 21 22 |
# File 'lib/gameday/game_info.rb', line 20 def third_base_ump ump("3B") end |
#ump(pos) ⇒ Object
27 28 29 |
# File 'lib/gameday/game_info.rb', line 27 def ump(pos) self.css('umpire[position="'+pos+'"]').attr("name").value end |