Class: Twilio::JWT::TaskRouterCapability
- 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
- #add_policy(policy) ⇒ Object
-
#initialize(account_sid, auth_token, workspace_sid, channel_id, nbf: nil, ttl: 3600, valid_until: nil) ⇒ TaskRouterCapability
constructor
A new instance of TaskRouterCapability.
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(account_sid, auth_token, workspace_sid, channel_id, nbf: nil, ttl: 3600, valid_until: nil) super(secret_key: auth_token, issuer: account_sid, nbf: nbf, ttl: ttl, valid_until: valid_until ) @account_sid = 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 |