Parent

Included Modules

Picombo::Cookie

Cookie handling class

In essense, a proxy to the rack cookie handling methods.

Example usage

Writing cookie values

 Picombo::Cookie.set(:sample, 'this is the content of the cookie')

Getting cookie values

 Picombo::Cookie.get(:sample)

Deleting a cookie

 Picombo::Cookie.delete(:sample)

Public Class Methods

delete(key) click to toggle source

Deletes a cookie item defined by key

    # File lib/classes/cookie.rb, line 36
36:         def self.delete(key)
37:             Picombo::Core.raw_response.delete_cookie(key)
38:         end
get(key, default = nil) click to toggle source

Retrieves a cookie item defined by key

    # File lib/classes/cookie.rb, line 24
24:         def self.get(key, default = nil)
25:             return @@req.cookies[key] if @@req.cookies.has_key?(key)
26: 
27:             default
28:         end
set(key, val) click to toggle source

Sets a cookie item defined by key to val

    # File lib/classes/cookie.rb, line 31
31:         def self.set(key, val)
32:             Picombo::Core.raw_response.set_cookie(key, val)
33:         end

Public Instance Methods

init(req) click to toggle source

Initializes the request for cookies

    # File lib/classes/cookie.rb, line 19
19:         def init(req)
20:             @@req = req
21:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.