Class: Protocol::HTTP::Header::Cookie

Inherits:
Multiple
  • Object
show all
Defined in:
lib/protocol/http/header/cookie.rb

Overview

The Cookie HTTP request header contains stored HTTP cookies previously sent by the server with the Set-Cookie header.

Direct Known Subclasses

SetCookie

Instance Method Summary collapse

Methods inherited from Multiple

#initialize, #to_s

Constructor Details

This class inherits a constructor from Protocol::HTTP::Header::Multiple

Instance Method Details

#to_hObject



31
32
33
34
35
36
37
# File 'lib/protocol/http/header/cookie.rb', line 31

def to_h
	cookies = self.collect do |string|
		HTTP::Cookie.parse(string)
	end
	
	cookies.map{|cookie| [cookie.name, cookie]}.to_h
end