Class: LiveKit::VideoGrant
- Inherits:
-
Object
- Object
- LiveKit::VideoGrant
- Defined in:
- lib/livekit/grants.rb
Instance Attribute Summary collapse
-
#canPublish ⇒ Object
Returns the value of attribute canPublish.
-
#canPublishData ⇒ Object
Returns the value of attribute canPublishData.
-
#canSubscribe ⇒ Object
Returns the value of attribute canSubscribe.
-
#hidden ⇒ Object
Returns the value of attribute hidden.
-
#recorder ⇒ Object
Returns the value of attribute recorder.
-
#room ⇒ Object
Returns the value of attribute room.
-
#roomAdmin ⇒ Object
Returns the value of attribute roomAdmin.
-
#roomCreate ⇒ Object
Returns the value of attribute roomCreate.
-
#roomJoin ⇒ Object
Returns the value of attribute roomJoin.
-
#roomList ⇒ Object
Returns the value of attribute roomList.
-
#roomRecord ⇒ Object
Returns the value of attribute roomRecord.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(roomCreate: nil, roomJoin: nil, roomList: nil, roomRecord: nil, roomAdmin: nil, room: nil, canPublish: nil, canSubscribe: nil, canPublishData: nil, hidden: nil, recorder: nil) ⇒ VideoGrant
constructor
A new instance of VideoGrant.
- #to_hash ⇒ Object
Constructor Details
#initialize(roomCreate: nil, roomJoin: nil, roomList: nil, roomRecord: nil, roomAdmin: nil, room: nil, canPublish: nil, canSubscribe: nil, canPublishData: nil, hidden: nil, recorder: nil) ⇒ VideoGrant
Returns a new instance of VideoGrant.
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 |
# File 'lib/livekit/grants.rb', line 39 def initialize( # true if can create or delete rooms roomCreate: nil, # true if can join room roomJoin: nil, # true if can list rooms roomList: nil, # true if can record roomRecord: nil, # true if can manage the room roomAdmin: nil, # name of the room for join or admin permissions room: nil, # for join tokens, can participant publish, true by default canPublish: nil, # for join tokens, can participant subscribe, true by default canSubscribe: nil, # for join tokens, can participant publish data messages, true by default canPublishData: nil, # if participant should remain invisible to others hidden: nil, # if participant is recording the room recorder: nil ) @roomCreate = roomCreate @roomJoin = roomJoin @roomList = roomList @roomRecord = roomRecord @roomAdmin = roomAdmin @room = room @canPublish = canPublish @canSubscribe = canSubscribe @canPublishData = canPublishData @hidden = hidden @recorder = recorder end |
Instance Attribute Details
#canPublish ⇒ Object
Returns the value of attribute canPublish.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def canPublish @canPublish end |
#canPublishData ⇒ Object
Returns the value of attribute canPublishData.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def canPublishData @canPublishData end |
#canSubscribe ⇒ Object
Returns the value of attribute canSubscribe.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def canSubscribe @canSubscribe end |
#hidden ⇒ Object
Returns the value of attribute hidden.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def hidden @hidden end |
#recorder ⇒ Object
Returns the value of attribute recorder.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def recorder @recorder end |
#room ⇒ Object
Returns the value of attribute room.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def room @room end |
#roomAdmin ⇒ Object
Returns the value of attribute roomAdmin.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def roomAdmin @roomAdmin end |
#roomCreate ⇒ Object
Returns the value of attribute roomCreate.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def roomCreate @roomCreate end |
#roomJoin ⇒ Object
Returns the value of attribute roomJoin.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def roomJoin @roomJoin end |
#roomList ⇒ Object
Returns the value of attribute roomList.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def roomList @roomList end |
#roomRecord ⇒ Object
Returns the value of attribute roomRecord.
36 37 38 |
# File 'lib/livekit/grants.rb', line 36 def roomRecord @roomRecord end |
Class Method Details
.from_hash(hash) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/livekit/grants.rb', line 76 def self.from_hash(hash) return nil if hash.nil? hash = hash.stringify_keys VideoGrant.new( roomCreate: hash["roomCreate"], roomJoin: hash["roomJoin"], roomList: hash["roomList"], roomRecord: hash["roomRecord"], roomAdmin: hash["roomAdmin"], room: hash["room"], canPublish: hash["canPublish"], canSubscribe: hash["canSubscribe"], canPublishData: hash["canPublishData"], hidden: hash["hidden"], recorder: hash["recorder"], ) end |
Instance Method Details
#to_hash ⇒ Object
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/livekit/grants.rb', line 96 def to_hash hash = {} instance_variables.each { |var| val = instance_variable_get(var) if val != nil hash[var.to_s.delete("@")] = val end } hash end |