Class: Pincers::Http::Cookie

Inherits:
Object
  • Object
show all
Defined in:
lib/pincers/http/cookie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_name, _value, _domain, _path = nil, _expires = nil, _secure = nil) ⇒ Cookie

Returns a new instance of Cookie.



6
7
8
9
10
11
12
13
# File 'lib/pincers/http/cookie.rb', line 6

def initialize(_name, _value, _domain, _path=nil, _expires=nil, _secure=nil)
  @name = _name
  @value = _value
  @domain = _domain.gsub(/^\./,'').downcase # RFC 6265 5.2.3
  @path = valid_path?(_path) ? _path.downcase : '/'
  @expires = _expires
  @secure = _secure
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



4
5
6
# File 'lib/pincers/http/cookie.rb', line 4

def domain
  @domain
end

#expiresObject (readonly)

Returns the value of attribute expires.



4
5
6
# File 'lib/pincers/http/cookie.rb', line 4

def expires
  @expires
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/pincers/http/cookie.rb', line 4

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/pincers/http/cookie.rb', line 4

def path
  @path
end

#secureObject (readonly)

Returns the value of attribute secure.



4
5
6
# File 'lib/pincers/http/cookie.rb', line 4

def secure
  @secure
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/pincers/http/cookie.rb', line 4

def value
  @value
end