class Twilio::JWT::ClientCapability
Attributes
account_sid[RW]
auth_token[RW]
client_name[RW]
scopes[RW]
Public Class Methods
new(account_sid, auth_token, scopes: [], nbf: nil, ttl: 3600, valid_until: nil)
click to toggle source
Calls superclass method
# File lib/twilio-ruby/jwt/client_capability.rb 17 def initialize(account_sid, auth_token, scopes: [], nbf: nil, ttl: 3600, valid_until: nil) 18 super(secret_key: auth_token, issuer: account_sid, nbf: nbf, ttl: ttl, valid_until: valid_until) 19 @account_sid = account_sid 20 @auth_token = auth_token 21 @client_name = nil 22 @scopes = scopes 23 end
Public Instance Methods
add_scope(scope)
click to toggle source
# File lib/twilio-ruby/jwt/client_capability.rb 25 def add_scope(scope) 26 @scopes.push(scope) 27 end
Protected Instance Methods
_generate_payload()
click to toggle source
# File lib/twilio-ruby/jwt/client_capability.rb 31 def _generate_payload 32 scope = '' 33 scope = @scopes.map(&:_generate_payload).join(' ') unless @scopes.empty? 34 35 payload = { 36 scope: scope 37 } 38 39 payload 40 end