Class: EveOnline::ESI::CharacterOnline

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/eve_online/esi/character_online.rb

Constant Summary collapse

API_ENDPOINT =
'https://esi.tech.ccp.is/v2/characters/%<character_id>s/online/?datasource=tranquility'

Instance Attribute Summary collapse

Attributes inherited from Base

#parser, #token

Instance Method Summary collapse

Methods inherited from Base

#content, #response, #user_agent

Constructor Details

#initialize(options) ⇒ CharacterOnline

Returns a new instance of CharacterOnline.



14
15
16
17
18
# File 'lib/eve_online/esi/character_online.rb', line 14

def initialize(options)
  super

  @character_id = options[:character_id]
end

Instance Attribute Details

#character_idObject (readonly)

Returns the value of attribute character_id.



12
13
14
# File 'lib/eve_online/esi/character_online.rb', line 12

def character_id
  @character_id
end

Instance Method Details

#modelObject



23
24
25
# File 'lib/eve_online/esi/character_online.rb', line 23

def model
  Models::Online.new(response)
end

#scopeObject



28
29
30
# File 'lib/eve_online/esi/character_online.rb', line 28

def scope
  'esi-location.read_online.v1'
end

#urlObject



32
33
34
# File 'lib/eve_online/esi/character_online.rb', line 32

def url
  format(API_ENDPOINT, character_id: character_id)
end