Class: Weapon
- Inherits:
-
Object
- Object
- Weapon
- Defined in:
- lib/weapons.rb
Instance Attribute Summary collapse
-
#damage ⇒ Object
Returns the value of attribute damage.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, damage) ⇒ Weapon
constructor
A new instance of Weapon.
Constructor Details
#initialize(name, damage) ⇒ Weapon
Returns a new instance of Weapon.
5 6 7 8 |
# File 'lib/weapons.rb', line 5 def initialize (name, damage) @name = name @damage = damage end |
Instance Attribute Details
#damage ⇒ Object
Returns the value of attribute damage.
3 4 5 |
# File 'lib/weapons.rb', line 3 def damage @damage end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/weapons.rb', line 3 def name @name end |