Sha256: 663a6c035112b2b731925b78c45899cfdf9d4ef9808be8e17de625d6cf147ac2

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class WarKillmails < Base
      API_ENDPOINT = 'https://esi.evetech.net/v1/wars/%<war_id>s/killmails/?datasource=%<datasource>s&page=%<page>s'

      attr_reader :war_id, :page

      def initialize(options = {})
        super

        @war_id = options.fetch(:war_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; end

      def url
        format(API_ENDPOINT, war_id: war_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/war_killmails.rb
eve_online-0.19.0 lib/eve_online/esi/war_killmails.rb