Class: Gameday::GameInfo

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/gameday/game_info.rb

Instance Method Summary collapse

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_umpObject



14
15
16
# File 'lib/gameday/game_info.rb', line 14

def first_base_ump
  ump("1B")
end

#home_plate_umpObject



23
24
25
# File 'lib/gameday/game_info.rb', line 23

def home_plate_ump
  ump("HP")
end

#second_base_umpObject



17
18
19
# File 'lib/gameday/game_info.rb', line 17

def second_base_ump
  ump("2B")
end

#third_base_umpObject



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