Class: Agora::AgoraDynamicKey2::ServiceRtc
- Defined in:
- lib/agora/dynamic_key2/access_token.rb
Constant Summary collapse
- SERVICE_TYPE =
1- PRIVILEGE_JOIN_CHANNEL =
1- PRIVILEGE_PUBLISH_AUDIO_STREAM =
2- PRIVILEGE_PUBLISH_VIDEO_STREAM =
3- PRIVILEGE_PUBLISH_DATA_STREAM =
4
Instance Attribute Summary collapse
-
#channel_name ⇒ Object
Returns the value of attribute channel_name.
-
#uid ⇒ Object
Returns the value of attribute uid.
Attributes inherited from Service
Instance Method Summary collapse
-
#initialize(channel_name = '', uid = '') ⇒ ServiceRtc
constructor
A new instance of ServiceRtc.
- #pack ⇒ Object
- #unpack(data) ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(channel_name = '', uid = '') ⇒ ServiceRtc
42 43 44 45 46 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 42 def initialize(channel_name = '', uid = '') super(SERVICE_TYPE) @channel_name = channel_name @uid = fetch_uid(uid) end |
Instance Attribute Details
#channel_name ⇒ Object
Returns the value of attribute channel_name.
34 35 36 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 34 def channel_name @channel_name end |
#uid ⇒ Object
Returns the value of attribute uid.
34 35 36 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 34 def uid @uid end |
Instance Method Details
#pack ⇒ Object
48 49 50 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 48 def pack super() + Util.pack_string(@channel_name) + Util.pack_string(@uid) end |
#unpack(data) ⇒ Object
52 53 54 55 56 |
# File 'lib/agora/dynamic_key2/access_token.rb', line 52 def unpack(data) _, data = super(data) @channel_name, data = Util.unpack_string(data) @uid, data = Util.unpack_string(data) end |