Class: HonStats::Classes::Creep
- Inherits:
-
Object
- Object
- HonStats::Classes::Creep
- Defined in:
- lib/honstats/character.rb
Overview
Consilidated creep stats
Instance Attribute Summary collapse
-
#damage ⇒ Object
readonly
Returns the value of attribute damage.
-
#denied_xp ⇒ Object
readonly
Returns the value of attribute denied_xp.
-
#denied_xp_per_minute ⇒ Object
readonly
Returns the value of attribute denied_xp_per_minute.
-
#denies ⇒ Object
readonly
Returns the value of attribute denies.
-
#denies_per_minute ⇒ Object
readonly
Returns the value of attribute denies_per_minute.
-
#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) ⇒ Creep
constructor
A new instance of Creep.
Constructor Details
#initialize(data) ⇒ Creep
Returns a new instance of Creep.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/honstats/character.rb', line 138 def initialize(data) @kills = HonStats::API.get_data("acc_teamcreepkills", data).to_i @damage = HonStats::API.get_data("acc_teamcreepdmg", data).to_i @xp = HonStats::API.get_data("acc_teamcreepexp", data).to_i @gold = HonStats::API.get_data("acc_teamcreepgold", data).to_i @denies = HonStats::API.get_data("acc_denies", data).to_i @denied_xp = HonStats::API.get_data("acc_exp_denied", 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) @denies_per_minute = "%.02f" % (@denies.to_f / minutes_played.to_f) @denied_xp_per_minute = "%.02f" % (@denied_xp.to_f / minutes_played.to_f) end |
Instance Attribute Details
#damage ⇒ Object (readonly)
Returns the value of attribute damage.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def damage @damage end |
#denied_xp ⇒ Object (readonly)
Returns the value of attribute denied_xp.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def denied_xp @denied_xp end |
#denied_xp_per_minute ⇒ Object (readonly)
Returns the value of attribute denied_xp_per_minute.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def denied_xp_per_minute @denied_xp_per_minute end |
#denies ⇒ Object (readonly)
Returns the value of attribute denies.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def denies @denies end |
#denies_per_minute ⇒ Object (readonly)
Returns the value of attribute denies_per_minute.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def denies_per_minute @denies_per_minute end |
#gold ⇒ Object (readonly)
Returns the value of attribute gold.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def gold @gold end |
#kills ⇒ Object (readonly)
Returns the value of attribute kills.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def kills @kills end |
#kills_per_minute ⇒ Object (readonly)
Returns the value of attribute kills_per_minute.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def kills_per_minute @kills_per_minute end |
#xp ⇒ Object (readonly)
Returns the value of attribute xp.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def xp @xp end |
#xp_per_minute ⇒ Object (readonly)
Returns the value of attribute xp_per_minute.
135 136 137 |
# File 'lib/honstats/character.rb', line 135 def xp_per_minute @xp_per_minute end |