Sha256: 3688f985654d307023ee6d04b479c5839b7fe3066d5f62d0a20cf4463d09bd33

Contents?: true

Size: 945 Bytes

Versions: 4

Compression:

Stored size: 945 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterIndustryJobs < Base
      API_PATH = '/v1/characters/%<character_id>s/industry/jobs/?datasource=%<datasource>s&include_completed=%<include_completed>s'

      attr_reader :character_id, :include_completed

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
        @include_completed = options.fetch(:include_completed, false)
      end

      def jobs
        @jobs ||=
          begin
            output = []
            response.each do |job|
              output << Models::CharacterIndustryJob.new(job)
            end
            output
          end
      end

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

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