Sha256: 2b3da554b51e55c98f736af77d069a6e12ca688d9f740aea7c8f2ae068ffef1f

Contents?: true

Size: 757 Bytes

Versions: 13

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class PublicContract < Base
      API_PATH = "/v1/contracts/public/items/%<contract_id>s/"

      attr_reader :contract_id, :page

      def initialize(options)
        super

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

      def items
        @items ||=
          begin
            output = []
            response.each do |item|
              output << Models::PublicContractItem.new(item)
            end
            output
          end
      end

      def scope
      end

      def additional_query_params
        [:page]
      end

      def path
        format(API_PATH, contract_id: contract_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_contract.rb
eve_online-0.45.0 lib/eve_online/esi/public_contract.rb
eve_online-0.44.0 lib/eve_online/esi/public_contract.rb
eve_online-0.43.0 lib/eve_online/esi/public_contract.rb
eve_online-0.42.0 lib/eve_online/esi/public_contract.rb
eve_online-0.41.0 lib/eve_online/esi/public_contract.rb
eve_online-0.40.0 lib/eve_online/esi/public_contract.rb
eve_online-0.39.0 lib/eve_online/esi/public_contract.rb
eve_online-0.38.0 lib/eve_online/esi/public_contract.rb
eve_online-0.37.0 lib/eve_online/esi/public_contract.rb
eve_online-0.36.0 lib/eve_online/esi/public_contract.rb
eve_online-0.35.1 lib/eve_online/esi/public_contract.rb
eve_online-0.35.0 lib/eve_online/esi/public_contract.rb