Class: Reve::Classes::Kill

Inherits:
Object show all
Defined in:
lib/reve/classes.rb

Overview

Simple class to contain the information relevant to a single Kill. Comprised of an array of KillLoss, an array of KillAttacker and one KillVictim Attributes

  • victim ( KillVictim ) - Instance of the KillVictim class to represent the victim of the Kill.

  • attackers ( [KillAttacker] ) - Array of KillAttacker objects that represent the people who killed the victim.

  • losses ( [KillLoss] ) - Array of KillLoss objects that represents the victim‘s items destroyed in the Kill.

  • system_id ( Fixnum ) - The ID of the System that the Kill took place in.

  • id ( Fixnum ) - The ID of this specific Kill

  • moon_id ( Fixnum | NilClass ) - The ID of the Moon that this kill happened at (due to a POS?), if any; nil otherwise.

See Also: KillAttacker, KillVictim, KillLoss, Reve::API#personal_kills, Reve::API#corporate_kills

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem, victim, attackers, losses) ⇒ Kill

:nodoc:



467
468
469
470
471
472
473
# File 'lib/reve/classes.rb', line 467

def initialize(elem, victim, attackers, losses) #:nodoc:
  @victim, @attackers, @losses = victim, attackers, losses
  @system_id = elem['solarSystemID'].to_i
  @created_at = elem['killTime'].to_time
  @id = elem['killID'].to_i
  @moon_id = elem['moonID'] == "0" ? nil : elem['moonID'].to_i
end

Instance Attribute Details

#attackersObject (readonly)

Returns the value of attribute attackers.



465
466
467
# File 'lib/reve/classes.rb', line 465

def attackers
  @attackers
end

#created_atObject (readonly)

Returns the value of attribute created_at.



466
467
468
# File 'lib/reve/classes.rb', line 466

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



466
467
468
# File 'lib/reve/classes.rb', line 466

def id
  @id
end

#lossesObject (readonly)

Returns the value of attribute losses.



465
466
467
# File 'lib/reve/classes.rb', line 465

def losses
  @losses
end

#moon_idObject (readonly)

Returns the value of attribute moon_id.



466
467
468
# File 'lib/reve/classes.rb', line 466

def moon_id
  @moon_id
end

#system_idObject (readonly)

Returns the value of attribute system_id.



466
467
468
# File 'lib/reve/classes.rb', line 466

def system_id
  @system_id
end

#victimObject (readonly)

Returns the value of attribute victim.



465
466
467
# File 'lib/reve/classes.rb', line 465

def victim
  @victim
end