class Cookie
Models an HTTP Cookie
Constants
- COOKIE_SEPARATOR
Separates cookies
- DOUBLE_COLON
Separates ruby class names in a FQN
- EMPTY_ARRAY
An empty frozen array
- EMPTY_HASH
An empty frozen hash
- EMPTY_STRING
An empty frozen string
- Error
Cookie
error base class- NAME_VALUE_SEPARATOR
Separates the cookie name from its value
- VERSION
Gem version
Public Class Methods
coerce(string)
click to toggle source
# File lib/cookie.rb, line 55 def self.coerce(string) new(*string.split(NAME_VALUE_SEPARATOR, 2)) end
Public Instance Methods
decode(decoder = Decoder::Base64)
click to toggle source
# File lib/cookie.rb, line 63 def decode(decoder = Decoder::Base64) new(decoder.call(value)) end
decrypt(box)
click to toggle source
# File lib/cookie.rb, line 71 def decrypt(box) new(box.decrypt(value)) end
encode(encoder = Encoder::Base64)
click to toggle source
# File lib/cookie.rb, line 59 def encode(encoder = Encoder::Base64) new(encoder.call(value)) end
encrypt(box)
click to toggle source
# File lib/cookie.rb, line 67 def encrypt(box) new(box.encrypt(value)) end
to_s()
click to toggle source
# File lib/cookie.rb, line 75 def to_s "#{name}=#{value}" end
Private Instance Methods
new(new_value)
click to toggle source
# File lib/cookie.rb, line 82 def new(new_value) self.class.new(name, new_value) end