Sha256: 2504df6c20ffffcc297b543a2b8778cb70b9b9b29fd82d3e26de86fd783e28b4

Contents?: true

Size: 870 Bytes

Versions: 4

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterKillmailsRecent < Base
      API_PATH = '/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
        @killmails ||=
          begin
            output = []
            response.each do |killmail|
              output << Models::KillmailShort.new(killmail)
            end
            output
          end
      end

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

      def url
        format("#{ API_HOST }#{ API_PATH }", character_id: character_id, datasource: datasource, page: page)
      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_killmails_recent.rb
eve_online-0.26.0 lib/eve_online/esi/character_killmails_recent.rb
eve_online-0.25.0 lib/eve_online/esi/character_killmails_recent.rb
eve_online-0.24.0 lib/eve_online/esi/character_killmails_recent.rb