Class: QueueIt::CookieManager
- Inherits:
-
Object
- Object
- QueueIt::CookieManager
- Defined in:
- lib/queueit_knownuserv3/known_user.rb
Instance Method Summary collapse
- #getCookie(name) ⇒ Object
-
#initialize(cookieJar) ⇒ CookieManager
constructor
A new instance of CookieManager.
- #setCookie(name, value, expire, domain) ⇒ Object
Constructor Details
#initialize(cookieJar) ⇒ CookieManager
Returns a new instance of CookieManager.
286 287 288 |
# File 'lib/queueit_knownuserv3/known_user.rb', line 286 def initialize() = end |
Instance Method Details
#getCookie(name) ⇒ Object
290 291 292 293 294 295 296 |
# File 'lib/queueit_knownuserv3/known_user.rb', line 290 def getCookie(name) key = name.to_sym if(!Utils.isNilOrEmpty([key])) return [key] end return nil end |
#setCookie(name, value, expire, domain) ⇒ Object
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/queueit_knownuserv3/known_user.rb', line 298 def setCookie(name, value, expire, domain) key = name.to_sym noDomain = Utils.isNilOrEmpty(domain) deleteCookie = Utils.isNilOrEmpty(value) noExpire = Utils.isNilOrEmpty(expire) if(noDomain) if(deleteCookie) .delete(key) else if(noExpire) [key] = { :value => value } else [key] = { :value => value, :expires => expire } end end else if(deleteCookie) .delete(key, :domain => domain) else if(noExpire) [key] = { :value => value, :domain => domain } else [key] = { :value => value, :expires => expire, :domain => domain } end end end end |