Class: L4DExplosive

Inherits:
Object
  • Object
show all
Includes:
GameWeapon
Defined in:
lib/steam/community/l4d/l4d_explosive.rb

Instance Attribute Summary

Attributes included from GameWeapon

#id, #kills, #shots

Instance Method Summary collapse

Methods included from GameWeapon

#avg_shots_per_kill

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_shotObject

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