Class: Player::PlayerTemplate
- Inherits:
-
Object
- Object
- Player::PlayerTemplate
- Defined in:
- lib/baseball/player.rb
Direct Known Subclasses
Batting::Batter, Fielding::Fielder, Pitching::Pitcher, Running::Runner
Instance Attribute Summary collapse
-
#player ⇒ Object
Returns the value of attribute player.
Instance Method Summary collapse
- #figure_trailing_zeroes(arg) ⇒ Object
-
#initialize(player) ⇒ PlayerTemplate
constructor
A new instance of PlayerTemplate.
Constructor Details
#initialize(player) ⇒ PlayerTemplate
5 6 7 |
# File 'lib/baseball/player.rb', line 5 def initialize(player) @player = player end |
Instance Attribute Details
#player ⇒ Object
Returns the value of attribute player.
4 5 6 |
# File 'lib/baseball/player.rb', line 4 def player @player end |
Instance Method Details
#figure_trailing_zeroes(arg) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/baseball/player.rb', line 9 def figure_trailing_zeroes(arg) revised_number = arg if revised_number.length === 3 revised_number = "#{revised_number}0" elsif revised_number.length === 2 revised_number = "#{revised_number}00" else return revised_number end end |