Class: LiveKit::ClaimGrant
- Inherits:
-
Object
- Object
- LiveKit::ClaimGrant
- Defined in:
- lib/livekit/grants.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#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.
-
#sip ⇒ Object
Returns the value of attribute sip.
-
#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
Returns a new instance of ClaimGrant.
21 22 23 24 25 26 27 28 29 |
# File 'lib/livekit/grants.rb', line 21 def initialize @identity = nil @name = nil @metadata = nil @sha256 = nil @video = nil @sip = nil @attributes = nil end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/livekit/grants.rb', line 5 def attributes @attributes end |
#identity ⇒ Object
Returns the value of attribute identity.
5 6 7 |
# File 'lib/livekit/grants.rb', line 5 def identity @identity end |
#metadata ⇒ Object
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/livekit/grants.rb', line 5 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/livekit/grants.rb', line 5 def name @name end |
#sha256 ⇒ Object
Returns the value of attribute sha256.
5 6 7 |
# File 'lib/livekit/grants.rb', line 5 def sha256 @sha256 end |
#sip ⇒ Object
Returns the value of attribute sip.
5 6 7 |
# File 'lib/livekit/grants.rb', line 5 def sip @sip end |
#video ⇒ Object
Returns the value of attribute video.
5 6 7 |
# File 'lib/livekit/grants.rb', line 5 def video @video end |
Class Method Details
.from_hash(hash) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/livekit/grants.rb', line 7 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.attributes = hash["attributes"] claim_grant.sha256 = hash["sha256"] claim_grant.video = VideoGrant.from_hash(hash["video"]) claim_grant.sip = SIPGrant.from_hash(hash["sip"]) return claim_grant end |
Instance Method Details
#to_hash ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/livekit/grants.rb', line 31 def to_hash val = { name: @name, metadata: @metadata, attributes: @attributes, sha256: @sha256, } if @video val[:video] = @video.to_hash end if @sip val[:sip] = @sip.to_hash end return val end |