Method: Cookie#initialize

Defined in:
lib/source/redshift/cookie.rb

#initialize(key, value, options = {}) ⇒ Cookie

call-seq:

Cookie.new(key, value, options = {}) -> cookie

Returns a new Cookie object with the given parameters and stores the data in the browser as cookie data. If the browser already has a cookie that matches key, that cookie’s parameters will be overwritten.

Cookie.new(:user_jds, '2237115568')   #=> #<Cookie: @key="user_jds" @value="2237115568">
Cookie.read(:user_jds)                #=> '2237115568'

Cookie.new(:user_jds, '8557acb0')     #=> #<Cookie: @key="user_jds" @value="8557acb0">
Cookie.read(:user_jds)                #=> '8557acb0'


54
55
56
57
# File 'lib/source/redshift/cookie.rb', line 54

def initialize(key, value, options = {})
  self.key = key
  self.update(value, OPTIONS.merge(options))
end