Sha256: eb83114cf836ec86ac94c45699088ecefe5e21104153c548f811c613be97be52

Contents?: true

Size: 738 Bytes

Versions: 3

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterStandings < Base
      API_ENDPOINT = 'https://esi.evetech.net/v1/characters/%<character_id>s/standings/?datasource=%<datasource>s'

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
      end

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

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

      def url
        format(API_ENDPOINT, character_id: character_id, datasource: datasource)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/character_standings.rb
eve_online-0.19.0 lib/eve_online/esi/character_standings.rb
eve_online-0.18.0 lib/eve_online/esi/character_standings.rb