Class: Agora::AgoraDynamicKey2::ServiceRtm
- Defined in:
- lib/agora/dynamic_key2/access_token.rb
Constant Summary collapse
- SERVICE_TYPE =
2- PRIVILEGE_JOIN_LOGIN =
1
Instance Attribute Summary collapse
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Attributes inherited from Service
Instance Method Summary collapse
-
#initialize(user_id = '') ⇒ ServiceRtm
constructor
A new instance of ServiceRtm.
- #pack ⇒ Object
- #unpack(data) ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(user_id = '') ⇒ ServiceRtm
Returns a new instance of ServiceRtm.
65 66 67 68 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 65 def initialize(user_id = '') super(SERVICE_TYPE) @user_id = user_id end |
Instance Attribute Details
#user_id ⇒ Object
Returns the value of attribute user_id.
60 61 62 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 60 def user_id @user_id end |
Instance Method Details
#pack ⇒ Object
70 71 72 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 70 def pack super() + Util.pack_string(@user_id) end |
#unpack(data) ⇒ Object
74 75 76 77 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 74 def unpack(data) _, data = super(data) @user_id, data = Util.unpack_string(data) end |