Class: Twilio::TaskRouter::WorkflowRuleTarget
- Inherits:
-
Object
- Object
- Twilio::TaskRouter::WorkflowRuleTarget
- Defined in:
- lib/twilio-ruby/task_router/workflow_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #expression ⇒ Object
-
#initialize(queue, priority = nil, timeout = nil, expression = nil) ⇒ WorkflowRuleTarget
constructor
A new instance of WorkflowRuleTarget.
- #priority ⇒ Object
- #queue ⇒ Object
- #timeout ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(queue, priority = nil, timeout = nil, expression = nil) ⇒ WorkflowRuleTarget
Returns a new instance of WorkflowRuleTarget.
87 88 89 90 91 92 |
# File 'lib/twilio-ruby/task_router/workflow_builder.rb', line 87 def initialize(queue, priority=nil, timeout=nil, expression=nil) @queue = queue @priority = priority @timeout = timeout @expression = expression end |
Class Method Details
.parse_json(target) ⇒ Object
124 125 126 |
# File 'lib/twilio-ruby/task_router/workflow_builder.rb', line 124 def self.parse_json(target) Twilio::TaskRouter::WorkflowRuleTarget.new target['queue'], target['priority'], target['timeout'], target['expression'] end |
Instance Method Details
#expression ⇒ Object
106 107 108 |
# File 'lib/twilio-ruby/task_router/workflow_builder.rb', line 106 def expression @expression end |
#priority ⇒ Object
98 99 100 |
# File 'lib/twilio-ruby/task_router/workflow_builder.rb', line 98 def priority @priority end |
#queue ⇒ Object
94 95 96 |
# File 'lib/twilio-ruby/task_router/workflow_builder.rb', line 94 def queue @queue end |
#timeout ⇒ Object
102 103 104 |
# File 'lib/twilio-ruby/task_router/workflow_builder.rb', line 102 def timeout @timeout end |
#to_json ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/twilio-ruby/task_router/workflow_builder.rb', line 110 def to_json target = {queue: @queue} unless @priority.nil? target['priority'] = @priority end unless @timeout.nil? target['timeout'] = @timeout end unless @expression.nil? target['expression'] = @expression end target end |