Sha256: ebd139648ba16ab12dac6f3bd2e3a3989013887be3f05d026be3245e313a8e1d

Contents?: true

Size: 787 Bytes

Versions: 2

Compression:

Stored size: 787 Bytes

Contents

module EveOnline
  module ESI
    class CorporationIndustryJobs < Base
      API_ENDPOINT = 'https://esi.tech.ccp.is/v1/corporations/%s/industry/jobs/?datasource=tranquility&include_completed=%s'.freeze

      attr_reader :corporation_id, :include_completed

      def initialize(options)
        super

        @corporation_id = options[:corporation_id]
        @include_completed = options[:include_completed] ? true : false
      end

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

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

      def url
        API_ENDPOINT % [corporation_id, include_completed]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.14.0 lib/eve_online/esi/corporation_industry_jobs.rb
eve_online-0.13.0 lib/eve_online/esi/corporation_industry_jobs.rb