Module: AbstractL4DWeapon
- Includes:
- GameWeapon
- Included in:
- L4D2Weapon, L4DWeapon
- Defined in:
- lib/steam/community/l4d/abstract_l4d_weapon.rb
Instance Attribute Summary collapse
-
#accuracy ⇒ Object
readonly
Returns the value of attribute accuracy.
-
#headshots_percentage ⇒ Object
readonly
Returns the value of attribute headshots_percentage.
-
#kill_percentage ⇒ Object
readonly
Returns the value of attribute kill_percentage.
Attributes included from GameWeapon
Instance Method Summary collapse
-
#initialize(weapon_data) ⇒ Object
Abstract base constructor which parses common data for both, L4DWeapon and L4D2Weapon.
Methods included from GameWeapon
Instance Attribute Details
#accuracy ⇒ Object (readonly)
Returns the value of attribute accuracy.
12 13 14 |
# File 'lib/steam/community/l4d/abstract_l4d_weapon.rb', line 12 def accuracy @accuracy end |
#headshots_percentage ⇒ Object (readonly)
Returns the value of attribute headshots_percentage.
12 13 14 |
# File 'lib/steam/community/l4d/abstract_l4d_weapon.rb', line 12 def headshots_percentage @headshots_percentage end |
#kill_percentage ⇒ Object (readonly)
Returns the value of attribute kill_percentage.
12 13 14 |
# File 'lib/steam/community/l4d/abstract_l4d_weapon.rb', line 12 def kill_percentage @kill_percentage end |
Instance Method Details
#initialize(weapon_data) ⇒ Object
Abstract base constructor which parses common data for both, L4DWeapon and L4D2Weapon
16 17 18 19 20 21 22 23 |
# File 'lib/steam/community/l4d/abstract_l4d_weapon.rb', line 16 def initialize(weapon_data) super weapon_data @accuracy = weapon_data.elements['accuracy'].text @headshots_percentage = weapon_data.elements['headshots'].text @id = weapon_data.name @shots = weapon_data.elements['shots'].text.to_i end |