class Pitcher

Attributes

earned_runs[R]
era[R]
full_name[R]
hits[R]
homeruns[R]
name[R]
outs[R]
runs[R]
strikeouts[R]
walks[R]

Public Class Methods

new(pitcher_xml) click to toggle source
# File lib/mlb_gd2/pitcher.rb, line 11
def initialize(pitcher_xml)
  @name        = pitcher_xml.attribute("name").value
  @full_name  = pitcher_xml.attribute("name_display_first_last").value
  @outs        = pitcher_xml.attribute("out").value
  @walks       = pitcher_xml.attribute("bb").value
  @strikeouts  = pitcher_xml.attribute("so").value
  @hits        = pitcher_xml.attribute("h").value
  @runs        = pitcher_xml.attribute("r").value
  @homeruns    = pitcher_xml.attribute("hr").value
  @earned_runs = pitcher_xml.attribute("er").value
  @era         = pitcher_xml.attribute("era").value
end

Public Instance Methods

ip() click to toggle source
# File lib/mlb_gd2/pitcher.rb, line 24
def ip
  "#{(outs.to_i / 3).to_s}.#{outs.to_i%3}"
end