Class: L4DExplosive
- Inherits:
-
Object
- Object
- L4DExplosive
- Includes:
- GameWeapon
- Defined in:
- lib/steam/community/l4d/l4d_explosive.rb
Instance Attribute Summary
Attributes included from GameWeapon
Instance Method Summary collapse
-
#avg_kills_per_shot ⇒ Object
Returns the average number of kills for one shot of this explosive.
-
#initialize(weapon_data) ⇒ L4DExplosive
constructor
Creates a new instance of L4DExplosive based on the assigned XML data.
Methods included from GameWeapon
Constructor Details
#initialize(weapon_data) ⇒ L4DExplosive
Creates a new instance of L4DExplosive based on the assigned XML data
13 14 15 16 17 18 |
# File 'lib/steam/community/l4d/l4d_explosive.rb', line 13 def initialize(weapon_data) super weapon_data @id = weapon_data.name @shots = weapon_data.elements['thrown'].text.to_i end |
Instance Method Details
#avg_kills_per_shot ⇒ Object
Returns the average number of kills for one shot of this explosive.
21 22 23 |
# File 'lib/steam/community/l4d/l4d_explosive.rb', line 21 def avg_kills_per_shot 1 / avg_shots_per_kill end |