Class: QueueIt::QueueUrlParams
- Inherits:
-
Object
- Object
- QueueIt::QueueUrlParams
- Defined in:
- lib/queueit_knownuserv3/queue_url_params.rb
Constant Summary collapse
- KEY_VALUE_SEPARATOR_GROUP_CHAR =
'~'- KEY_VALUE_SEPARATOR_CHAR =
'_'- TIMESTAMP_KEY =
"ts"- COOKIE_VALIDITY_MINUTE_KEY =
"cv"- EVENT_ID_KEY =
"e"- EXTENDABLE_COOKIE_KEY =
"ce"- HASH_KEY =
"h"- QUEUE_ID_KEY =
"q"- REDIRECT_TYPE_KEY =
"rt"
Instance Attribute Summary collapse
-
#cookieValidityMinute ⇒ Object
Returns the value of attribute cookieValidityMinute.
-
#eventId ⇒ Object
Returns the value of attribute eventId.
-
#extendableCookie ⇒ Object
Returns the value of attribute extendableCookie.
-
#hashCode ⇒ Object
Returns the value of attribute hashCode.
-
#queueId ⇒ Object
Returns the value of attribute queueId.
-
#queueITToken ⇒ Object
Returns the value of attribute queueITToken.
-
#queueITTokenWithoutHash ⇒ Object
Returns the value of attribute queueITTokenWithoutHash.
-
#redirectType ⇒ Object
Returns the value of attribute redirectType.
-
#timeStamp ⇒ Object
Returns the value of attribute timeStamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ QueueUrlParams
constructor
A new instance of QueueUrlParams.
Constructor Details
#initialize ⇒ QueueUrlParams
Returns a new instance of QueueUrlParams.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 23 def initialize @timeStamp = 0 @eventId = "" @hashCode = "" @extendableCookie = false = nil @queueITToken = "" @queueITTokenWithoutHash = "" @queueId = "" @redirectType = nil end |
Instance Attribute Details
#cookieValidityMinute ⇒ Object
Returns the value of attribute cookieValidityMinute.
17 18 19 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 17 def end |
#eventId ⇒ Object
Returns the value of attribute eventId.
14 15 16 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 14 def eventId @eventId end |
#extendableCookie ⇒ Object
Returns the value of attribute extendableCookie.
16 17 18 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 16 def extendableCookie @extendableCookie end |
#hashCode ⇒ Object
Returns the value of attribute hashCode.
15 16 17 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 15 def hashCode @hashCode end |
#queueId ⇒ Object
Returns the value of attribute queueId.
20 21 22 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 20 def queueId @queueId end |
#queueITToken ⇒ Object
Returns the value of attribute queueITToken.
18 19 20 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 18 def queueITToken @queueITToken end |
#queueITTokenWithoutHash ⇒ Object
Returns the value of attribute queueITTokenWithoutHash.
19 20 21 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 19 def queueITTokenWithoutHash @queueITTokenWithoutHash end |
#redirectType ⇒ Object
Returns the value of attribute redirectType.
21 22 23 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 21 def redirectType @redirectType end |
#timeStamp ⇒ Object
Returns the value of attribute timeStamp.
13 14 15 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 13 def timeStamp @timeStamp end |
Class Method Details
.extractQueueParams(queueitToken) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/queueit_knownuserv3/queue_url_params.rb', line 35 def self.extractQueueParams(queueitToken) begin if(Utils.isNilOrEmpty(queueitToken)) return nil end result = QueueUrlParams.new result.queueITToken = queueitToken paramsNameValueList = result.queueITToken.split(KEY_VALUE_SEPARATOR_GROUP_CHAR) paramsNameValueList.each do |pNameValue| paramNameValueArr = pNameValue.split(KEY_VALUE_SEPARATOR_CHAR) case paramNameValueArr[0] when TIMESTAMP_KEY begin result.timeStamp = Integer(paramNameValueArr[1]) rescue result.timeStamp = 0 end when COOKIE_VALIDITY_MINUTE_KEY begin result. = Integer(paramNameValueArr[1]) rescue result. = nil end when EVENT_ID_KEY result.eventId = paramNameValueArr[1] when EXTENDABLE_COOKIE_KEY if paramNameValueArr[1].upcase.eql? 'TRUE' result.extendableCookie = true end when HASH_KEY result.hashCode = paramNameValueArr[1] when QUEUE_ID_KEY result.queueId = paramNameValueArr[1] when REDIRECT_TYPE_KEY result.redirectType = paramNameValueArr[1] end end result.queueITTokenWithoutHash = result.queueITToken.gsub((KEY_VALUE_SEPARATOR_GROUP_CHAR + HASH_KEY + KEY_VALUE_SEPARATOR_CHAR + result.hashCode), "") return result rescue return nil end end |