Class: L4D2Weapon
- Inherits:
-
Object
- Object
- L4D2Weapon
- Includes:
- AbstractL4DWeapon
- Defined in:
- lib/steam/community/l4d/l4d2_weapon.rb
Instance Attribute Summary collapse
-
#damage ⇒ Object
readonly
Returns the value of attribute damage.
-
#weapon_group ⇒ Object
readonly
Returns the value of attribute weapon_group.
Attributes included from AbstractL4DWeapon
#accuracy, #headshots_percentage, #kill_percentage
Attributes included from GameWeapon
Instance Method Summary collapse
-
#initialize(weapon_data) ⇒ L4D2Weapon
constructor
Creates a new instance of L4D2Weapon based on the assigned XML data.
Methods included from GameWeapon
Constructor Details
#initialize(weapon_data) ⇒ L4D2Weapon
Creates a new instance of L4D2Weapon based on the assigned XML data
15 16 17 18 19 20 21 |
# File 'lib/steam/community/l4d/l4d2_weapon.rb', line 15 def initialize(weapon_data) super weapon_data @damage = weapon_data.elements['damage'].text.to_i @kill_percentage = weapon_data.elements['pctkills'].text @weapon_group = weapon_data.attribute('group') end |
Instance Attribute Details
#damage ⇒ Object (readonly)
Returns the value of attribute damage.
12 13 14 |
# File 'lib/steam/community/l4d/l4d2_weapon.rb', line 12 def damage @damage end |
#weapon_group ⇒ Object (readonly)
Returns the value of attribute weapon_group.
12 13 14 |
# File 'lib/steam/community/l4d/l4d2_weapon.rb', line 12 def weapon_group @weapon_group end |