Sha256: 981e9e4a5b4dac26993290de3382b19a6bff0fcd9871ca8468ed5ac8f3ac07c8

Contents?: true

Size: 686 Bytes

Versions: 8

Compression:

Stored size: 686 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  class Request
    attr_reader :url, :body, :headers, :debug

    # @param [String] url The HTTP request URL
    # @param [String] body The HTTP request body
    # # @param [String] readable_body Human-readable HTTP request body
    # @param [Hash] headers The HTTP request headers
    # @param [Boolean] debug Whether to debug the request
    def initialize(url:, body: nil, readable_body: nil, headers: {}, debug: false)
      @url = url
      @body = body
      @readable_body = readable_body
      @headers = headers
      @debug = debug
    end

    def readable_body
      @readable_body.presence || @body
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
friendly_shipping-0.6.5 lib/friendly_shipping/request.rb
friendly_shipping-0.6.4 lib/friendly_shipping/request.rb
friendly_shipping-0.6.3 lib/friendly_shipping/request.rb
friendly_shipping-0.6.2 lib/friendly_shipping/request.rb
friendly_shipping-0.6.1 lib/friendly_shipping/request.rb
friendly_shipping-0.6.0 lib/friendly_shipping/request.rb
friendly_shipping-0.5.3 lib/friendly_shipping/request.rb
friendly_shipping-0.5.2 lib/friendly_shipping/request.rb