Class: Isomorfeus::Puppetmaster::Cookie

Inherits:
Object
  • Object
show all
Defined in:
lib/isomorfeus/puppetmaster/cookie.rb

Instance Method Summary collapse

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

#domainObject



13
14
15
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 13

def domain
  @attributes['domain']
end

#expiresObject



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

Returns:

  • (Boolean)


21
22
23
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 21

def http_only?
  !!@attributes['httpOnly']
end

#nameObject



25
26
27
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 25

def name
  @attributes['name']
end

#pathObject



33
34
35
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 33

def path
  @attributes['path']
end

#same_siteObject



41
42
43
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 41

def same_site
  @attributes['sameSite']
end

#secure?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 37

def secure?
  !!@attributes['secure']
end

#valueObject



29
30
31
# File 'lib/isomorfeus/puppetmaster/cookie.rb', line 29

def value
  @attributes['value']
end