Sha256: 5dd6948fdefac883826977418b9ef9f2b17282865776c8d4c54112efda8eaf7e

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

module Shipcloud
  module Request
    class Info
      attr_accessor :http_method, :api_url, :api_key, :data, :affiliate_id

      def initialize(http_method, api_url, api_key, data, affiliate_id)
        @api_key      = api_key
        @http_method  = http_method
        @api_url      = api_url
        @data         = data
        @affiliate_id = affiliate_id
      end

      def url
        url = "/#{API_VERSION}/#{api_url}"
        url
      end

      def path_with_params(path, params)
        unless params.empty?
          encoded_params = URI.encode_www_form(params)
          [path, encoded_params].join("?")
        else
          path
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shipcloud-0.11.0 lib/shipcloud/request/info.rb
shipcloud-0.10.0 lib/shipcloud/request/info.rb