Class: Twilio::JWT::TaskRouterCapability::Policy

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, method, allowed, post_filters = {}, query_filters = {}) ⇒ Policy

Returns a new instance of Policy.


58
59
60
61
62
63
64
# File 'lib/twilio-ruby/jwt/task_router.rb', line 58

def initialize(url, method, allowed, post_filters = {}, query_filters = {})
  @url = url
  @method = method
  @allowed = allowed
  @post_filters = post_filters
  @query_filters = query_filters
end

Instance Attribute Details

#allowedObject

Returns the value of attribute allowed


52
53
54
# File 'lib/twilio-ruby/jwt/task_router.rb', line 52

def allowed
  @allowed
end

#methodObject

Returns the value of attribute method


52
53
54
# File 'lib/twilio-ruby/jwt/task_router.rb', line 52

def method
  @method
end

#post_filtersObject

Returns the value of attribute post_filters


52
53
54
# File 'lib/twilio-ruby/jwt/task_router.rb', line 52

def post_filters
  @post_filters
end

#query_filtersObject

Returns the value of attribute query_filters


52
53
54
# File 'lib/twilio-ruby/jwt/task_router.rb', line 52

def query_filters
  @query_filters
end

#urlObject

Returns the value of attribute url


52
53
54
# File 'lib/twilio-ruby/jwt/task_router.rb', line 52

def url
  @url
end

Instance Method Details

#_generate_payloadObject


66
67
68
69
70
71
72
73
74
75
# File 'lib/twilio-ruby/jwt/task_router.rb', line 66

def _generate_payload
  policy = {
    url: @url,
    method: @method,
    query_filter: @query_filters,
    post_filter: @post_filters,
    allow: @allowed
  }
  policy
end