Skip to content

Commit

Permalink
Simpler setter for participant attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao committed Oct 29, 2024
1 parent 4f3e128 commit c75c6d0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/livekit/access_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,32 @@ def add_grant(video_grant)
if video_grant.is_a?(Hash)
video_grant = VideoGrant.from_hash(video_grant)
end
self.set_video_grant(video_grant)
end

def set_video_grant(video_grant)
@grants.video = video_grant
end

def add_sip_grant(sip_grant)
if sip_grant.is_a?(Hash)
sip_grant = SIPGrant.from_hash(sip_grant)
end
self.set_sip_grant(sip_grant)
end

def set_sip_grant(sip_grant)
@grants.sip = sip_grant
end

def metadata=(participant_md)
@grants.metadata = participant_md
end

def attributes=(participant_attributes)
@grants.attributes = participant_attributes
end

def name=(participant_name)
@grants.name = participant_name
end
Expand Down

0 comments on commit c75c6d0

Please sign in to comment.