Class: EveOnline::ESI::CharacterStandings

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

Constant Summary collapse

API_PATH =
"/v1/characters/%<character_id>s/standings/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CharacterStandings

Returns a new instance of CharacterStandings.



10
11
12
13
14
# File 'lib/eve_online/esi/character_standings.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_standings.rb', line 8

def character_id
  @character_id
end

Instance Method Details

#pathObject



31
32
33
# File 'lib/eve_online/esi/character_standings.rb', line 31

def path
  format(API_PATH, character_id: character_id)
end

#scopeObject



27
28
29
# File 'lib/eve_online/esi/character_standings.rb', line 27

def scope
  "esi-characters.read_standings.v1"
end

#standingsObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/eve_online/esi/character_standings.rb', line 16

def standings
  @standings ||=
    begin
      output = []
      response.each do |standing|
        output << Models::Standing.new(standing)
      end
      output
    end
end