Sha256: c2e319cdd91c7e88084f590e29f8945c637f8206ae27f265b1498699d6c0644a

Contents?: true

Size: 784 Bytes

Versions: 4

Compression:

Stored size: 784 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterLoyaltyPoints < Base
      API_PATH = '/v1/characters/%<character_id>s/loyalty/points/?datasource=%<datasource>s'

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
      end

      def loyalty_points
        @loyalty_points ||=
          begin
            output = []
            response.each do |lp|
              output << Models::LoyaltyPoint.new(lp)
            end
            output
          end
      end

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

      def url
        format("#{ API_HOST }#{ API_PATH }", character_id: character_id, datasource: datasource)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eve_online-0.27.0 lib/eve_online/esi/character_loyalty_points.rb
eve_online-0.26.0 lib/eve_online/esi/character_loyalty_points.rb
eve_online-0.25.0 lib/eve_online/esi/character_loyalty_points.rb
eve_online-0.24.0 lib/eve_online/esi/character_loyalty_points.rb