Class: Reve::Classes::Character

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

Overview

Represents a Character for the Reve::API#characters, Reve::API#character_name and Reve::API#character_id calls. Attributes

  • name ( String ) - Name of the Character

  • id ( Fixnum ) - ID of the Character (use this for Reve::API method calls)

  • corporation_name ( String | NilClass ) - Name of the Corporation the Character belongs to. Nil if being used for Reve::API#character_name or Reve::API#character_id

  • corporation_id ( Fixnum | NilClass ) - ID of the Corporation the Character belongs to. Nil if being used for Reve::API#character_name or Reve::API#character_id

See Also: Reve::API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ Character

:nodoc:



542
543
544
545
546
547
# File 'lib/reve/classes.rb', line 542

def initialize(elem) #:nodoc:
  @id               = elem['characterID'].to_i
  @name             = elem['name']
  @corporation_name = elem['corporationName']
  @corporation_id   = elem['corporationID'].to_i
end

Instance Attribute Details

#corporation_idObject (readonly)

Returns the value of attribute corporation_id.



541
542
543
# File 'lib/reve/classes.rb', line 541

def corporation_id
  @corporation_id
end

#corporation_nameObject (readonly)

Returns the value of attribute corporation_name.



541
542
543
# File 'lib/reve/classes.rb', line 541

def corporation_name
  @corporation_name
end

#idObject (readonly)

Returns the value of attribute id.



541
542
543
# File 'lib/reve/classes.rb', line 541

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



541
542
543
# File 'lib/reve/classes.rb', line 541

def name
  @name
end