Class: Isomorfeus::Puppetmaster::Cookie
- Inherits:
-
Object
- Object
- Isomorfeus::Puppetmaster::Cookie
- Defined in:
- lib/isomorfeus/puppetmaster/cookie.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #domain ⇒ Object
- #expires ⇒ Object
- #http_only? ⇒ Boolean
-
#initialize(attributes) ⇒ Cookie
constructor
A new instance of Cookie.
- #name ⇒ Object
- #path ⇒ Object
- #same_site ⇒ Object
- #secure? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Cookie
Returns a new instance of Cookie.
4 5 6 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 4 def initialize(attributes) @attributes = attributes end |
Instance Method Details
#==(other) ⇒ Object
8 9 10 11 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 8 def ==(other) return super unless other.is_a? String value == other end |
#domain ⇒ Object
13 14 15 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 13 def domain @attributes['domain'] end |
#expires ⇒ Object
17 18 19 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 17 def expires Time.at @attributes['expires'] unless [nil, 0, -1].include? @attributes['expires'] end |
#http_only? ⇒ Boolean
21 22 23 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 21 def http_only? !!@attributes['httpOnly'] end |
#name ⇒ Object
25 26 27 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 25 def name @attributes['name'] end |
#path ⇒ Object
33 34 35 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 33 def path @attributes['path'] end |
#same_site ⇒ Object
41 42 43 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 41 def same_site @attributes['sameSite'] end |
#secure? ⇒ Boolean
37 38 39 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 37 def secure? !!@attributes['secure'] end |
#value ⇒ Object
29 30 31 |
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 29 def value @attributes['value'] end |