Class: AgoraDynamicKey2::ServiceChat
- Defined in:
- lib/dynamic_key2/access_token.rb
Constant Summary collapse
- SERVICE_TYPE =
5- PRIVILEGE_USER =
1- PRIVILEGE_APP =
2
Instance Attribute Summary collapse
-
#uid ⇒ Object
Returns the value of attribute uid.
Attributes inherited from Service
Instance Method Summary collapse
-
#initialize(uid = '') ⇒ ServiceChat
constructor
A new instance of ServiceChat.
- #pack ⇒ Object
- #unpack(data) ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(uid = '') ⇒ ServiceChat
Returns a new instance of ServiceChat.
104 105 106 107 |
# File 'lib/dynamic_key2/access_token.rb', line 104 def initialize(uid = '') super(SERVICE_TYPE) @uid = fetch_uid(uid) end |
Instance Attribute Details
#uid ⇒ Object
Returns the value of attribute uid.
98 99 100 |
# File 'lib/dynamic_key2/access_token.rb', line 98 def uid @uid end |
Instance Method Details
#pack ⇒ Object
109 110 111 |
# File 'lib/dynamic_key2/access_token.rb', line 109 def pack super() + Util.pack_string(@uid) end |
#unpack(data) ⇒ Object
113 114 115 116 |
# File 'lib/dynamic_key2/access_token.rb', line 113 def unpack(data) _, data = super(data) @uid, data = Util.unpack_string(data) end |