Class: Twilio::JWT::TaskRouterCapability

Inherits:
BaseJWT
  • Object
show all
Defined in:
lib/twilio-ruby/jwt/task_router.rb

Defined Under Namespace

Classes: Policy, TaskRouterUtils

Constant Summary collapse

TASK_ROUTER_VERSION =
'v1'.freeze

Instance Method Summary collapse

Methods inherited from BaseJWT

#_generate_headers, #headers, #payload, #to_jwt

Constructor Details

#initialize(account_sid, auth_token, workspace_sid, channel_id, nbf: nil, ttl: 3600, valid_until: nil) ⇒ TaskRouterCapability

Returns a new instance of TaskRouterCapability.


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/twilio-ruby/jwt/task_router.rb', line 7

def initialize(, auth_token, workspace_sid, channel_id, nbf: nil, ttl: 3600, valid_until: nil)
  super(secret_key: auth_token,
        issuer: ,
        nbf: nbf,
        ttl: ttl,
        valid_until: valid_until
  )
  @account_sid = 
  @auth_token = auth_token
  @workspace_sid = workspace_sid
  @channel_id = channel_id
  @policies = []
end

Instance Method Details

#add_policy(policy) ⇒ Object


21
22
23
# File 'lib/twilio-ruby/jwt/task_router.rb', line 21

def add_policy(policy)
  @policies.push(policy)
end