Class: HonStats::Classes::Neutral

Inherits:
Object
  • Object
show all
Defined in:
lib/honstats/character.rb

Overview

Consilidated neutral creep stats

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#damageObject (readonly)

Returns the value of attribute damage.



156
157
158
# File 'lib/honstats/character.rb', line 156

def damage
  @damage
end

#goldObject (readonly)

Returns the value of attribute gold.



156
157
158
# File 'lib/honstats/character.rb', line 156

def gold
  @gold
end

#killsObject (readonly)

Returns the value of attribute kills.



156
157
158
# File 'lib/honstats/character.rb', line 156

def kills
  @kills
end

#kills_per_minuteObject (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

#xpObject (readonly)

Returns the value of attribute xp.



156
157
158
# File 'lib/honstats/character.rb', line 156

def xp
  @xp
end

#xp_per_minuteObject (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