Sha256: 6cecbf823814e8c9f0e155c43bdd1ac712710eba297af9990a3c1b2aece606e5

Contents?: true

Size: 788 Bytes

Versions: 51

Compression:

Stored size: 788 Bytes

Contents

require 'delegate'

module HTTParty
  class Response #:nodoc:
    class Headers < ::SimpleDelegator
      include ::Net::HTTPHeader

      def initialize(header_values = nil)
        @header = {}
        if header_values
          header_values.each_pair do |k,v|
            if v.is_a?(Array)
              v.each do |sub_v|
                add_field(k, sub_v)
              end
            else
              add_field(k, v)
            end
          end
        end
        super(@header)
      end

      def ==(other)
        if other.is_a?(::Net::HTTPHeader)
          @header == other.instance_variable_get(:@header)
        elsif other.is_a?(Hash)
          @header == other || @header == Headers.new(other).instance_variable_get(:@header)
        end
      end
    end
  end
end

Version data entries

51 entries across 26 versions & 4 rubygems

Version Path
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/paynow_sdk-1.0.9/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.1.0 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/paynow_sdk-1.0.9/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.1.0 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/paynow_sdk-1.0.9/vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.9 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.9 vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.9 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.8 vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.8 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.8 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.7 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.7 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.6 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.6 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.5 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.5 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb
paynow_sdk-1.0.4 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb