Class: EveOnline::Api::SolarSystem

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/eve_online/api/solar_system.rb

Instance Method Summary collapse

Constructor Details

#initialize(fragment) ⇒ SolarSystem

Returns a new instance of SolarSystem.



7
8
9
# File 'lib/eve_online/api/solar_system.rb', line 7

def initialize fragment
  self.fragment = fragment
end

Instance Method Details

#<=>(other) ⇒ Object



31
32
33
# File 'lib/eve_online/api/solar_system.rb', line 31

def <=> other
  name <=> other.name
end

#alliance_idObject



19
20
21
# File 'lib/eve_online/api/solar_system.rb', line 19

def alliance_id
  fragment['allianceID']
end

#corporation_idObject



23
24
25
# File 'lib/eve_online/api/solar_system.rb', line 23

def corporation_id
  fragment['corporationID']
end

#faction_idObject



27
28
29
# File 'lib/eve_online/api/solar_system.rb', line 27

def faction_id
  fragment['factionID']
end

#idObject



11
12
13
# File 'lib/eve_online/api/solar_system.rb', line 11

def id
  fragment['solarSystemID']
end

#nameObject



15
16
17
# File 'lib/eve_online/api/solar_system.rb', line 15

def name
  fragment['solarSystemName']
end

#to_s(indent = 0) ⇒ Object



36
37
38
39
# File 'lib/eve_online/api/solar_system.rb', line 36

def to_s indent = 0
  margin = " " * indent
  "#{margin}#{name} Solar System (id:#{id}, alliance:#{alliance_id}, corporation:#{corporation_id}, faction:#{faction_id})"
end