Class: L4DWeapon
- Inherits:
-
Object
- Object
- L4DWeapon
- Includes:
- AbstractL4DWeapon
- Defined in:
- lib/steam/community/l4d/l4d_weapon.rb
Overview
This class represents the statistics of a single weapon for a user in Left4Dead
Instance Attribute Summary
Attributes included from AbstractL4DWeapon
#accuracy, #headshots_percentage, #id, #kill_percentage, #shots
Attributes included from GameWeapon
Instance Method Summary collapse
-
#initialize(weapon_name, weapon_data) ⇒ L4DWeapon
constructor
Creates a new instance of a weapon based on the given XML data.
Methods included from GameWeapon
Constructor Details
#initialize(weapon_name, weapon_data) ⇒ L4DWeapon
Creates a new instance of a weapon based on the given XML data
20 21 22 23 24 |
# File 'lib/steam/community/l4d/l4d_weapon.rb', line 20 def initialize(weapon_name, weapon_data) super @kill_percentage = weapon_data['killpct'].to_f * 0.01 end |