Class: EveOnline::ESI::CharacterClones

Inherits:
Base
  • Object
show all
Defined in:
lib/eve_online/esi/character_clones.rb

Constant Summary collapse

API_PATH =
"/v3/characters/%<character_id>s/clones/"

Constants inherited from Base

Base::API_HOST

Instance Attribute Summary collapse

Attributes inherited from Base

#_open_timeout, #_read_timeout, #_write_timeout, #adapter, #language, #middlewares, #token

Instance Method Summary collapse

Methods inherited from Base

#add_middleware, #additional_query_params, #base_query_params, #connection, #error_limit_remain, #error_limit_reset, #http_method, #open_timeout, #open_timeout=, #page, #query, #read_timeout, #read_timeout=, #request_id, #resource, #response, #total_pages, #uri, #url, #user_agent, #write_timeout, #write_timeout=

Constructor Details

#initialize(options) ⇒ CharacterClones

Returns a new instance of CharacterClones.



10
11
12
13
14
# File 'lib/eve_online/esi/character_clones.rb', line 10

def initialize(options)
  super

  @character_id = options.fetch(:character_id)
end

Instance Attribute Details

#character_idObject (readonly)

Returns the value of attribute character_id.



8
9
10
# File 'lib/eve_online/esi/character_clones.rb', line 8

def character_id
  @character_id
end

Instance Method Details

#home_locationObject



16
17
18
# File 'lib/eve_online/esi/character_clones.rb', line 16

def home_location
  @home_location ||= Models::HomeLocation.new(response["home_location"])
end

#jump_clonesObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/eve_online/esi/character_clones.rb', line 20

def jump_clones
  @jump_clones ||=
    begin
      output = []
      response["jump_clones"].each do |jump_clone|
        output << Models::JumpClone.new(jump_clone)
      end
      output
    end
end

#last_clone_jump_dateObject



31
32
33
34
35
# File 'lib/eve_online/esi/character_clones.rb', line 31

def last_clone_jump_date
  last_clone_jump_date = response["last_clone_jump_date"]

  parse_datetime_with_timezone(last_clone_jump_date) if last_clone_jump_date
end

#last_station_change_dateObject



37
38
39
40
41
# File 'lib/eve_online/esi/character_clones.rb', line 37

def last_station_change_date
  last_station_change_date = response["last_station_change_date"]

  parse_datetime_with_timezone(last_station_change_date) if last_station_change_date
end

#pathObject



47
48
49
# File 'lib/eve_online/esi/character_clones.rb', line 47

def path
  format(API_PATH, character_id: character_id)
end

#scopeObject



43
44
45
# File 'lib/eve_online/esi/character_clones.rb', line 43

def scope
  "esi-clones.read_clones.v1"
end