Class: EveCrest::Response::SolarSystem

Inherits:
BaseResponse show all
Defined in:
lib/responses/solar_system.rb

Instance Attribute Summary

Attributes inherited from BaseResponse

#data

Instance Method Summary collapse

Methods inherited from BaseResponse

#cached_until, #error_message, #initialize, #raw, #success?

Constructor Details

This class inherits a constructor from EveCrest::BaseResponse

Instance Method Details

#constellationObject



39
40
41
# File 'lib/responses/solar_system.rb', line 39

def constellation
  data['constellation']['id']
end

#moonsObject



18
19
20
21
22
23
24
# File 'lib/responses/solar_system.rb', line 18

def moons
  _moons = Array.new
  data['planets'].each do |p|
    _moons.push(p['moons'].to_s.split('/')[4].to_i)
  end
  _moons
end

#nameObject



4
5
6
# File 'lib/responses/solar_system.rb', line 4

def name
  data['name']
end

#planetsObject



10
11
12
13
14
15
16
17
# File 'lib/responses/solar_system.rb', line 10

def planets
  #only returns an array planets ids
  _planets = Array.new
  data['planets'].each do |p|
    _planets.push(p['href'].to_s.split('/')[4].to_i)
  end
  _planets
end

#positionObject



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

def position
  data['position']
end

#security_levelObject



32
33
34
# File 'lib/responses/solar_system.rb', line 32

def security_level
  data['securityStatus']
end

#sovereigntyObject



35
36
37
# File 'lib/responses/solar_system.rb', line 35

def sovereignty
  data['sovereignty']['id']
end

#stargatesObject



25
26
27
28
29
30
31
# File 'lib/responses/solar_system.rb', line 25

def stargates
  _stargates = Array.new
  data['stargates'].each do |s|
    _stargates.push(s['id'])
  end
  _stargates
end