Class: Reve::Classes::CorporationSheet

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

Overview

Describes a Corporation. The public listing when a Corporation is in an Alliance is limited. When the requestor is in the Corporation for which the CorporationSheet is for then the details are full. Attributes

  • id ( Fixnum ) - ID of the Corporation

  • name ( String ) - Name of the Corporation

  • ticker ( String ) - Ticker (short name) of the Corporation

  • ceo_id ( Fixnum ) - The ID of the Character who is the CEO of the Corporation

  • ceo_name ( String ) - The name of the Character whois he CEO of the Corporation

  • station_id ( Fixnum ) - The ID of the Corporation’s home Station

  • station_name ( Station ) - The name of the Corporation’s home Station

  • description ( String ) - Corporation’s description

  • url ( String ) - URL of the Corporation’s website. If none is set the value is an empty String

  • alliance_id ( Fixnum | NilClass ) - ID of the Alliance that this Corporation belongs to; nil if no membership

  • alliance_name ( String | NilClass ) - Name of the Alliance that this Corporation belongs to; nil if no membership

  • tax_rate ( Float ) - Tax rate for the Corporation

  • member_count ( Fixnum ) - How many Characters are in the Corporation

  • member_limit ( Fixnum ) - Member limit (Max number of Characters allowed in?)

  • shares ( Fixnum ) - Number of shares available for the Corporation

  • divisions ( [CorporateDivision] ) - Array of CorporateDivision objects representing the differet divisions in the Corporation

  • wallet_divisions ( [WalletDivision] ) - Array of WalletDivision objects representing the different divisions in the wallet for the Corporation

  • logo ( CorporateLogo ) - An object to represent the Corporation’s logo.

See Also: CorporateLogo, WalletDivision, CorporateDivision, Corporation, Reve::API#corporation_sheet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h, divisions = [], wallet_divisions = [], logo = Reve::Classes::CorporateLogo.new(Hash.new(0))) ⇒ CorporationSheet

Call it h here cos it’s a Hash and not any Hpricot object like in other constructors



824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# File 'lib/reve/classes.rb', line 824

def initialize(h, divisions = [],wallet_divisions = [],  =Reve::Classes::CorporateLogo.new(Hash.new(0)) ) #:nodoc:
  @divisions = divisions
  @wallet_divisions = wallet_divisions
  @logo = 
  @id = h[:id].to_i
  @name = h[:name]
  @ticker = h[:ticker]
  @ceo_id = h[:ceo_id].to_i
  @ceo_name = h[:ceo_name]
  @station_id = h[:station_id].to_i
  @station_name = h[:station_name]
  @description = h[:description].split(/\n/).collect { |s| s.strip }.join(' ') # newlines to spaces
  @url = h[:url] || ""
  @alliance_id = h[:alliance_id].to_i rescue nil
  @alliance_name = h[:alliance_name] rescue nil
  @tax_rate = h[:tax_rate].to_f
  @member_count = h[:member_count].to_i
  @member_limit = h[:member_limit].to_i
  @shares = h[:shares].to_i
end

Instance Attribute Details

#alliance_idObject (readonly)

Returns the value of attribute alliance_id.



819
820
821
# File 'lib/reve/classes.rb', line 819

def alliance_id
  @alliance_id
end

#alliance_nameObject (readonly)

Returns the value of attribute alliance_name.



819
820
821
# File 'lib/reve/classes.rb', line 819

def alliance_name
  @alliance_name
end

#ceo_idObject (readonly)

Returns the value of attribute ceo_id.



819
820
821
# File 'lib/reve/classes.rb', line 819

def ceo_id
  @ceo_id
end

#ceo_nameObject (readonly)

Returns the value of attribute ceo_name.



819
820
821
# File 'lib/reve/classes.rb', line 819

def ceo_name
  @ceo_name
end

#descriptionObject (readonly)

Returns the value of attribute description.



819
820
821
# File 'lib/reve/classes.rb', line 819

def description
  @description
end

#divisionsObject

Returns the value of attribute divisions.



821
822
823
# File 'lib/reve/classes.rb', line 821

def divisions
  @divisions
end

#idObject (readonly)

Returns the value of attribute id.



819
820
821
# File 'lib/reve/classes.rb', line 819

def id
  @id
end

#logoObject

Returns the value of attribute logo.



821
822
823
# File 'lib/reve/classes.rb', line 821

def 
  @logo
end

#member_countObject (readonly)

Returns the value of attribute member_count.



819
820
821
# File 'lib/reve/classes.rb', line 819

def member_count
  @member_count
end

#member_limitObject (readonly)

Returns the value of attribute member_limit.



819
820
821
# File 'lib/reve/classes.rb', line 819

def member_limit
  @member_limit
end

#nameObject (readonly)

Returns the value of attribute name.



819
820
821
# File 'lib/reve/classes.rb', line 819

def name
  @name
end

#sharesObject (readonly)

Returns the value of attribute shares.



819
820
821
# File 'lib/reve/classes.rb', line 819

def shares
  @shares
end

#station_idObject (readonly)

Returns the value of attribute station_id.



819
820
821
# File 'lib/reve/classes.rb', line 819

def station_id
  @station_id
end

#station_nameObject (readonly)

Returns the value of attribute station_name.



819
820
821
# File 'lib/reve/classes.rb', line 819

def station_name
  @station_name
end

#tax_rateObject (readonly)

Returns the value of attribute tax_rate.



819
820
821
# File 'lib/reve/classes.rb', line 819

def tax_rate
  @tax_rate
end

#tickerObject (readonly)

Returns the value of attribute ticker.



819
820
821
# File 'lib/reve/classes.rb', line 819

def ticker
  @ticker
end

#urlObject (readonly)

Returns the value of attribute url.



819
820
821
# File 'lib/reve/classes.rb', line 819

def url
  @url
end

#wallet_divisionsObject

Returns the value of attribute wallet_divisions.



821
822
823
# File 'lib/reve/classes.rb', line 821

def wallet_divisions
  @wallet_divisions
end