Class: Innards::CookieHandler
- Inherits:
-
Object
- Object
- Innards::CookieHandler
- Defined in:
- lib/innards/cookie_handler.rb
Overview
Handles Digest Authentication
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(params) ⇒ CookieHandler
constructor
A new instance of CookieHandler.
- #parse(cookie_header) ⇒ Object
Constructor Details
#initialize(params) ⇒ CookieHandler
Returns a new instance of CookieHandler.
8 9 10 |
# File 'lib/innards/cookie_handler.rb', line 8 def initialize(params) @params = params end |
Instance Method Details
#build ⇒ Object
18 19 20 21 |
# File 'lib/innards/cookie_handler.rb', line 18 def build = @params[:cookies] URI.encode_www_form() unless .empty? end |
#parse(cookie_header) ⇒ Object
12 13 14 15 16 |
# File 'lib/innards/cookie_handler.rb', line 12 def parse .scan(/(\w+)=(.+?);/) { @params[:cookies].push([$1, $2]) } end |