Sha256: 5b9f02bad8234e04fe4958b45015ffaa2702b73dbea2f3cc3a8d41e6abf693d7

Contents?: true

Size: 555 Bytes

Versions: 43

Compression:

Stored size: 555 Bytes

Contents

class HTTParty::CookieHash < Hash #:nodoc:
  CLIENT_COOKIES = %w(path expires domain path secure httponly samesite)

  def add_cookies(data)
    case data
    when Hash
      merge!(data)
    when String
      data.split('; ').each do |cookie|
        key, value = cookie.split('=', 2)
        self[key.to_sym] = value if key
      end
    else
      raise "add_cookies only takes a Hash or a String"
    end
  end

  def to_cookie_string
    select { |k, v| !CLIENT_COOKIES.include?(k.to_s.downcase) }.collect { |k, v| "#{k}=#{v}" }.join("; ")
  end
end

Version data entries

43 entries across 18 versions & 3 rubygems

Version Path
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/cookie_hash.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/cookie_hash.rb
paynow_sdk-1.1.0 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.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/cookie_hash.rb
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/cookie_hash.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.rb
paynow_sdk-1.0.9 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.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/cookie_hash.rb
paynow_sdk-1.0.9 vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.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/cookie_hash.rb
paynow_sdk-1.0.8 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.rb
paynow_sdk-1.0.8 vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.rb
paynow_sdk-1.0.7 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.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/cookie_hash.rb
paynow_sdk-1.0.6 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.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/cookie_hash.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/cookie_hash.rb
paynow_sdk-1.0.5 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.rb
paynow_sdk-1.0.4 vendor/cache/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.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/cookie_hash.rb