Class: Reve::Classes::CharacterInfo

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

Overview

Represents a CharacterInfo for Reve::API#character_info Basic Attributes

  • id ( Fixnum ) - ID of the Character

  • name ( String ) - Name of the Character

  • race ( String ) - Race of the Character

  • bloodline ( String ) - Bloodline of the Character

  • corporation_id ( Fixnum ) - ID of the Corporation the Character is in

  • corporation_name ( String ) - Name of the Corporation the Character is in

  • corporation_date ( Time ) - Date the Character joined his Corporation

  • alliance_id ( Fixnum | NilClass ) - The ID of the Alliance the Character is in, if any. Will be nil unless the victim was in an Alliance

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

  • alliance_date ( Time | NilClass ) - Date the Character’s Corporations joined the Alliance.

  • security_status ( Float ) - Security status of the Character

Limited Attributes

  • skillpoints ( Fixnum ) - The amount of Skillpoints

  • skill_training_ends ( Time )-

  • ship_name ( String ) -

  • ship_type_id ( Fixnum ) -

  • ship_type_name ( String ) -

Full Attributes

  • last_known_location ( String ) -

  • acount_balance ( Float )

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ CharacterInfo

:nodoc:



1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
# File 'lib/reve/classes.rb', line 1643

def initialize(elem) #:nodoc:
  @id = (elem/'characterID').inner_html.to_i
  @name = (elem/'characterName').inner_html
  @dob = (elem/'DoB').inner_html
  @race = (elem/'race').inner_html
  @bloodline = (elem/'bloodline').inner_html
  @ancestry = (elem/'ancestry').inner_html
  @corporation_id = (elem/'corporationID').inner_html.to_i
  @corporation_name = (elem/'corporation').inner_html
  @corporation_date = Time.parse((elem/'corporationDate').inner_html)
  @alliance_id = (elem/'allianceID').inner_html.to_i
  @alliance_name = (elem/'alliance').inner_html
  @alliance_date = Time.parse((elem/'alliancenDate').inner_html)
  @security_status  = (elem/'securityStatus').inner_html.to_f
  @skillpoints = (elem/'skillPoints').inner_html == "" ? nil : (elem/'skillPoints').inner_html.to_i
  @skill_training_ends = (elem/'nextTrainingEnds').inner_html == "" ? nil : Time.parse((elem/'nextTrainingEnds').inner_html)
  @ship_name = (elem/'shipName').inner_html == "" ? nil : (elem/'shipName').inner_html
  @ship_type_id = (elem/'shipTypeID').inner_html == "" ? nil : (elem/'shipTypeID').inner_html.to_i
  @ship_type_name = (elem/'shipTypeName').inner_html == "" ? nil : (elem/'shipTypeName').inner_html
  @last_known_location = (elem/'lastKnownLocation').inner_html == "" ? nil : (elem/'lastKnownLocation').inner_html
  @acount_balance = (elem/'accountBalance').inner_html == "" ? nil : (elem/'accountBalance').inner_html.to_f
end

Instance Attribute Details

#acount_balanceObject (readonly)

Returns the value of attribute acount_balance.



1641
1642
1643
# File 'lib/reve/classes.rb', line 1641

def acount_balance
  @acount_balance
end

#alliance_dateObject (readonly)

Returns the value of attribute alliance_date.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def alliance_date
  @alliance_date
end

#alliance_idObject (readonly)

Returns the value of attribute alliance_id.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def alliance_id
  @alliance_id
end

#alliance_nameObject (readonly)

Returns the value of attribute alliance_name.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def alliance_name
  @alliance_name
end

#bloodlineObject (readonly)

Returns the value of attribute bloodline.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def bloodline
  @bloodline
end

#corporation_dateObject (readonly)

Returns the value of attribute corporation_date.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def corporation_date
  @corporation_date
end

#corporation_idObject (readonly)

Returns the value of attribute corporation_id.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def corporation_id
  @corporation_id
end

#corporation_nameObject (readonly)

Returns the value of attribute corporation_name.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def corporation_name
  @corporation_name
end

#idObject (readonly)

Returns the value of attribute id.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def id
  @id
end

#last_known_locationObject (readonly)

Returns the value of attribute last_known_location.



1641
1642
1643
# File 'lib/reve/classes.rb', line 1641

def last_known_location
  @last_known_location
end

#nameObject (readonly)

Returns the value of attribute name.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def name
  @name
end

#raceObject (readonly)

Returns the value of attribute race.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def race
  @race
end

#security_statusObject (readonly)

Returns the value of attribute security_status.



1639
1640
1641
# File 'lib/reve/classes.rb', line 1639

def security_status
  @security_status
end

#ship_nameObject (readonly)

Returns the value of attribute ship_name.



1640
1641
1642
# File 'lib/reve/classes.rb', line 1640

def ship_name
  @ship_name
end

#ship_type_idObject (readonly)

Returns the value of attribute ship_type_id.



1640
1641
1642
# File 'lib/reve/classes.rb', line 1640

def ship_type_id
  @ship_type_id
end

#ship_type_nameObject (readonly)

Returns the value of attribute ship_type_name.



1640
1641
1642
# File 'lib/reve/classes.rb', line 1640

def ship_type_name
  @ship_type_name
end

#skill_training_endsObject (readonly)

Returns the value of attribute skill_training_ends.



1640
1641
1642
# File 'lib/reve/classes.rb', line 1640

def skill_training_ends
  @skill_training_ends
end

#skillpointsObject (readonly)

Returns the value of attribute skillpoints.



1640
1641
1642
# File 'lib/reve/classes.rb', line 1640

def skillpoints
  @skillpoints
end

Instance Method Details

#typeObject



1667
1668
1669
1670
1671
1672
1673
1674
1675
# File 'lib/reve/classes.rb', line 1667

def type
  if self.acount_balance
    return :full
  elsif self.skillpoints
    return :limited
  else
    return :basic
  end
end