Class: LiveKit::ClaimGrant
- Inherits:
-
Object
- Object
- LiveKit::ClaimGrant
- Defined in:
- lib/livekit/grants.rb
Instance Attribute Summary collapse
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sha256 ⇒ Object
Returns the value of attribute sha256.
-
#video ⇒ Object
Returns the value of attribute video.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ClaimGrant
constructor
A new instance of ClaimGrant.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ ClaimGrant
17 18 19 20 21 22 23 |
# File 'lib/livekit/grants.rb', line 17 def initialize @identity = nil @name = nil = nil @sha256 = nil @video = nil end |
Instance Attribute Details
#identity ⇒ Object
Returns the value of attribute identity.
3 4 5 |
# File 'lib/livekit/grants.rb', line 3 def identity @identity end |
#metadata ⇒ Object
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/livekit/grants.rb', line 3 def end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/livekit/grants.rb', line 3 def name @name end |
#sha256 ⇒ Object
Returns the value of attribute sha256.
3 4 5 |
# File 'lib/livekit/grants.rb', line 3 def sha256 @sha256 end |
#video ⇒ Object
Returns the value of attribute video.
3 4 5 |
# File 'lib/livekit/grants.rb', line 3 def video @video end |
Class Method Details
.from_hash(hash) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/livekit/grants.rb', line 5 def self.from_hash(hash) return nil if hash.nil? claim_grant = ClaimGrant.new claim_grant.identity = hash["sub"] claim_grant.name = hash["name"] claim_grant. = hash["metadata"] claim_grant.sha256 = hash["sha256"] claim_grant.video = VideoGrant.from_hash(hash["video"]) return claim_grant end |
Instance Method Details
#to_hash ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/livekit/grants.rb', line 25 def to_hash { name: @name, metadata: , sha256: @sha256, video: @video.to_hash, } end |