Sha256: 8c26029affdc64bae0c798084fc7665b7c62144549bd0f41d292af41442582dd

Contents?: true

Size: 752 Bytes

Versions: 13

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class PublicContracts < Base
      API_PATH = "/v1/contracts/public/%<region_id>s/"

      attr_reader :region_id, :page

      def initialize(options)
        super

        @region_id = options.fetch(:region_id)
        @page = options.fetch(:page, 1)
      end

      def contracts
        @contracts ||=
          begin
            output = []
            response.each do |contract|
              output << Models::PublicContract.new(contract)
            end
            output
          end
      end

      def scope
      end

      def additional_query_params
        [:page]
      end

      def path
        format(API_PATH, region_id: region_id)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
eve_online-0.46.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.45.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.44.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.43.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.42.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.41.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.40.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.39.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.38.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.37.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.36.0 lib/eve_online/esi/public_contracts.rb
eve_online-0.35.1 lib/eve_online/esi/public_contracts.rb
eve_online-0.35.0 lib/eve_online/esi/public_contracts.rb