Class: BattingStats

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ BattingStats

Returns a new instance of BattingStats.



91
92
93
94
95
96
97
98
99
100
# File 'lib/batter.rb', line 91

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.



89
90
91
# File 'lib/batter.rb', line 89

def ab
  @ab
end

#avgObject

Returns the value of attribute avg.



89
90
91
# File 'lib/batter.rb', line 89

def avg
  @avg
end

#bbObject

Returns the value of attribute bb.



89
90
91
# File 'lib/batter.rb', line 89

def bb
  @bb
end

#desObject

Returns the value of attribute des.



89
90
91
# File 'lib/batter.rb', line 89

def des
  @des
end

#hrObject

Returns the value of attribute hr.



89
90
91
# File 'lib/batter.rb', line 89

def hr
  @hr
end

#soObject

Returns the value of attribute so.



89
90
91
# File 'lib/batter.rb', line 89

def so
  @so
end