Class: OpponentStats

Inherits:
Object
  • Object
show all
Defined in:
lib/pitcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ OpponentStats

Returns a new instance of OpponentStats.



121
122
123
124
125
126
127
128
129
130
# File 'lib/pitcher.rb', line 121

def initialize(element)
  if element.attributes['des']
    @des = element.attributes['des']
  end
  @avg = element.attributes['avg']
  @ab = element.attributes['ab']
  @hr = element.attributes['hr']
  @bb = element.attributes['bb']
  @so = element.attributes['so']
end

Instance Attribute Details

#abObject

Returns the value of attribute ab.



119
120
121
# File 'lib/pitcher.rb', line 119

def ab
  @ab
end

#avgObject

Returns the value of attribute avg.



119
120
121
# File 'lib/pitcher.rb', line 119

def avg
  @avg
end

#bbObject

Returns the value of attribute bb.



119
120
121
# File 'lib/pitcher.rb', line 119

def bb
  @bb
end

#desObject

Returns the value of attribute des.



119
120
121
# File 'lib/pitcher.rb', line 119

def des
  @des
end

#hrObject

Returns the value of attribute hr.



119
120
121
# File 'lib/pitcher.rb', line 119

def hr
  @hr
end

#soObject

Returns the value of attribute so.



119
120
121
# File 'lib/pitcher.rb', line 119

def so
  @so
end