Class: Reve::Classes::KillVictim

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

Overview

Represents the victim of a Kill. Attributes:

  • id ( Fixnum ) - ID of the Character that was killed.

  • name ( String ) - The name of the Character that was killed.

  • corporation_id ( Fixnum ) - The ID of the Corporation that the victim belongs to.

  • corporation_name ( String ) - Name of the Corporation that the victim belongs to.

  • alliance_id ( Fixnum | NilClass ) - The ID of the Alliance that the victim belongs to, if applicable. Will be nil unless the victim was in an Alliance

  • alliance_name ( String | NilClass ) - Name of the Alliance the Character is in, if any.

  • damage_taken ( Fixnum ) - The amount of damage the victim took before being killed.

  • ship_type_id ( Fixnum ) - ID of the ship type (references CCP data dump) that the victim was flying.

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ KillVictim

:nodoc:



342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/reve/classes.rb', line 342

def initialize(elem) #:nodoc:
  @id = elem['characterID'].to_i
  @name = elem['characterName']
  @corporation_id = elem['corporationID']
  @corporation_name = elem['corporationName']
  @alliance_id = elem['allianceID'] == "0" ? nil : elem['allianceID'].to_i
  @faction_id = elem['factionID'] == "0" ? nil : elem['factionID'].to_i
  @faction_id = elem['factionID'] == "0" ? nil : elem['factionID'].to_i
  @faction_name = elem['factionName'].empty? ? nil : elem['factionName']
  @alliance_name = elem['allianceName'].empty? ? nil : elem['allianceName']
  @damage_taken = elem['damageTaken'].to_i
  @ship_type_id = elem['shipTypeID'].to_i
end

Instance Attribute Details

#alliance_idObject (readonly)

Returns the value of attribute alliance_id.



341
342
343
# File 'lib/reve/classes.rb', line 341

def alliance_id
  @alliance_id
end

#corporation_idObject (readonly)

Returns the value of attribute corporation_id.



341
342
343
# File 'lib/reve/classes.rb', line 341

def corporation_id
  @corporation_id
end

#corporation_nameObject (readonly)

Returns the value of attribute corporation_name.



341
342
343
# File 'lib/reve/classes.rb', line 341

def corporation_name
  @corporation_name
end

#damage_takenObject (readonly)

Returns the value of attribute damage_taken.



341
342
343
# File 'lib/reve/classes.rb', line 341

def damage_taken
  @damage_taken
end

#faction_idObject (readonly)

Returns the value of attribute faction_id.



341
342
343
# File 'lib/reve/classes.rb', line 341

def faction_id
  @faction_id
end

#faction_nameObject (readonly)

Returns the value of attribute faction_name.



341
342
343
# File 'lib/reve/classes.rb', line 341

def faction_name
  @faction_name
end

#idObject (readonly)

Returns the value of attribute id.



341
342
343
# File 'lib/reve/classes.rb', line 341

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



341
342
343
# File 'lib/reve/classes.rb', line 341

def name
  @name
end

#ship_type_idObject (readonly)

Returns the value of attribute ship_type_id.



341
342
343
# File 'lib/reve/classes.rb', line 341

def ship_type_id
  @ship_type_id
end