Class: Ogem::Player
- Inherits:
-
Object
- Object
- Ogem::Player
- Defined in:
- lib/ogem/player.class.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#r ⇒ Object
Returns the value of attribute r.
Instance Method Summary collapse
-
#initialize(name = "Player", m = 1000, c = 1000, d = 0) ⇒ Player
constructor
A new instance of Player.
Constructor Details
#initialize(name = "Player", m = 1000, c = 1000, d = 0) ⇒ Player
Returns a new instance of Player.
9 10 11 12 13 14 15 16 17 |
# File 'lib/ogem/player.class.rb', line 9 def initialize name="Player", m=1000, c=1000, d=0 if !name.is_a?String Error.call "Ogem::Player::new : invalid name", Error::ERR_MEDIUM name = "Player" end @name = name @r = {m: m.to_i, c: c.to_i, d: d.to_i} end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/ogem/player.class.rb', line 7 def name @name end |
#r ⇒ Object
Returns the value of attribute r.
7 8 9 |
# File 'lib/ogem/player.class.rb', line 7 def r @r end |