Class: HonStats::Classes::Neutral
- Inherits:
-
Object
- Object
- HonStats::Classes::Neutral
- Defined in:
- lib/honstats/character.rb
Overview
Consilidated neutral creep stats
Instance Attribute Summary collapse
-
#damage ⇒ Object
readonly
Returns the value of attribute damage.
-
#gold ⇒ Object
readonly
Returns the value of attribute gold.
-
#kills ⇒ Object
readonly
Returns the value of attribute kills.
-
#kills_per_minute ⇒ Object
readonly
Returns the value of attribute kills_per_minute.
-
#xp ⇒ Object
readonly
Returns the value of attribute xp.
-
#xp_per_minute ⇒ Object
readonly
Returns the value of attribute xp_per_minute.
Instance Method Summary collapse
-
#initialize(data) ⇒ Neutral
constructor
A new instance of Neutral.
Constructor Details
#initialize(data) ⇒ Neutral
Returns a new instance of Neutral.
158 159 160 161 162 163 164 165 166 167 |
# File 'lib/honstats/character.rb', line 158 def initialize(data) @kills = HonStats::API.get_data("acc_neutralcreepkills", data).to_i @damage = HonStats::API.get_data("acc_neutralcreepdmg", data).to_i @xp = HonStats::API.get_data("acc_neutralcreepexp", data).to_i @gold = HonStats::API.get_data("acc_neutralcreepgold", data).to_i minutes_played = HonStats::API.get_data("acc_secs", data).to_i / 60 @kills_per_minute = "%.02f" % (@kills.to_f / minutes_played.to_f) @xp_per_minute = "%.02f" % (@xp.to_f / minutes_played.to_f) end |
Instance Attribute Details
#damage ⇒ Object (readonly)
Returns the value of attribute damage.
156 157 158 |
# File 'lib/honstats/character.rb', line 156 def damage @damage end |
#gold ⇒ Object (readonly)
Returns the value of attribute gold.
156 157 158 |
# File 'lib/honstats/character.rb', line 156 def gold @gold end |
#kills ⇒ Object (readonly)
Returns the value of attribute kills.
156 157 158 |
# File 'lib/honstats/character.rb', line 156 def kills @kills end |
#kills_per_minute ⇒ Object (readonly)
Returns the value of attribute kills_per_minute.
156 157 158 |
# File 'lib/honstats/character.rb', line 156 def kills_per_minute @kills_per_minute end |
#xp ⇒ Object (readonly)
Returns the value of attribute xp.
156 157 158 |
# File 'lib/honstats/character.rb', line 156 def xp @xp end |
#xp_per_minute ⇒ Object (readonly)
Returns the value of attribute xp_per_minute.
156 157 158 |
# File 'lib/honstats/character.rb', line 156 def xp_per_minute @xp_per_minute end |