Sha256: ab310f48f98f1dcf7b4612ce1472a9c2faa362b5477a190579364954acbb5866

Contents?: true

Size: 833 Bytes

Versions: 2

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterKillmailsRecent < Base
      API_ENDPOINT = 'https://esi.evetech.net/v1/characters/%<character_id>s/killmails/recent/?datasource=%<datasource>s&page=%<page>s'

      attr_reader :character_id, :page

      def initialize(options = {})
        super

        @character_id = options.fetch(:character_id)
        @page = options.fetch(:page, 1)
      end

      def killmails
        output = []
        response.each do |killmail|
          output << Models::KillmailShort.new(killmail)
        end
        output
      end
      memoize :killmails

      def scope
        'esi-killmails.read_killmails.v1'
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/character_killmails_recent.rb
eve_online-0.19.0 lib/eve_online/esi/character_killmails_recent.rb