Class: L4DWeapon

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

Instance Attribute Summary collapse

Attributes included from GameWeapon

#id, #kills, #shots

Instance Method Summary collapse

Methods included from GameWeapon

#avg_shots_per_kill

Constructor Details

#initialize(weapon_data) ⇒ L4DWeapon

Creates a new instance of L4DWeapon based on the assigned XML data



15
16
17
18
19
# File 'lib/steam/community/l4d/l4d_weapon.rb', line 15

def initialize(weapon_data)
  super weapon_data

  @kill_percentage = weapon_data.elements['killpct'].text
end

Instance Attribute Details

#accuracyObject (readonly)

Returns the value of attribute accuracy.



12
13
14
# File 'lib/steam/community/l4d/l4d_weapon.rb', line 12

def accuracy
  @accuracy
end

#headshots_percentageObject (readonly)

Returns the value of attribute headshots_percentage.



12
13
14
# File 'lib/steam/community/l4d/l4d_weapon.rb', line 12

def headshots_percentage
  @headshots_percentage
end

#kill_percentageObject (readonly)

Returns the value of attribute kill_percentage.



12
13
14
# File 'lib/steam/community/l4d/l4d_weapon.rb', line 12

def kill_percentage
  @kill_percentage
end