Class: Twilio::REST::Studio::V1::FlowContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Studio::V1::FlowContext
- Defined in:
- lib/twilio-ruby/rest/studio/v1/flow.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Defined Under Namespace
Classes: EngagementContext, EngagementInstance, EngagementList, EngagementPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the FlowInstance.
-
#engagements(sid = :unset) ⇒ EngagementList, EngagementContext
Access the engagements.
-
#fetch ⇒ FlowInstance
Fetch a FlowInstance.
-
#initialize(version, sid) ⇒ FlowContext
constructor
Initialize the FlowContext.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ FlowContext
Initialize the FlowContext
154 155 156 157 158 159 160 161 162 163 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 154 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Flows/#{@solution[:sid]}" # Dependents @engagements = nil end |
Instance Method Details
#delete ⇒ Boolean
Deletes the FlowInstance
183 184 185 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 183 def delete @version.delete('delete', @uri) end |
#engagements(sid = :unset) ⇒ EngagementList, EngagementContext
Access the engagements
191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 191 def engagements(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return EngagementContext.new(@version, @solution[:sid], sid, ) end unless @engagements @engagements = EngagementList.new(@version, flow_sid: @solution[:sid], ) end @engagements end |
#fetch ⇒ FlowInstance
Fetch a FlowInstance
168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 168 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) FlowInstance.new(@version, payload, sid: @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
207 208 209 210 |
# File 'lib/twilio-ruby/rest/studio/v1/flow.rb', line 207 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.FlowContext #{context}>" end |