Sha256: 3de358addb45ef28fe4d32ffd597a93144b585489ecb7f99fc3cef5870ff1921

Contents?: true

Size: 898 Bytes

Versions: 1

Compression:

Stored size: 898 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CorporationKillmailsRecent < Base
      API_PATH = '/v1/corporations/%<corporation_id>s/killmails/recent/?datasource=%<datasource>s&page=%<page>s'

      attr_reader :corporation_id, :page

      def initialize(options = {})
        super

        @corporation_id = options.fetch(:corporation_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_corporation_killmails.v1'
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eve_online-0.24.0 lib/eve_online/esi/corporation_killmails_recent.rb