Sha256: 6cd48c4712678a8c57d2fa3a92eec0281d67d3061ccb2747c01e1baa927fa09d

Contents?: true

Size: 1001 Bytes

Versions: 2

Compression:

Stored size: 1001 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CorporationIndustryJobs < Base
      API_ENDPOINT = 'https://esi.evetech.net/v1/corporations/%<corporation_id>s/industry/jobs/?datasource=%<datasource>s&include_completed=%<include_completed>s&page=%<page>s'

      attr_reader :corporation_id, :include_completed, :page

      def initialize(options)
        super

        @corporation_id = options.fetch(:corporation_id)
        @include_completed = options.fetch(:include_completed, false)
        @page = options.fetch(:page, 1)
      end

      def jobs
        output = []
        response.each do |job|
          output << Models::CorporationIndustryJob.new(job)
        end
        output
      end
      memoize :jobs

      def scope
        'esi-industry.read_corporation_jobs.v1'
      end

      def url
        format(API_ENDPOINT, corporation_id: corporation_id, include_completed: include_completed, 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/corporation_industry_jobs.rb
eve_online-0.19.0 lib/eve_online/esi/corporation_industry_jobs.rb