Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext::StepContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb,
lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb

Defined Under Namespace

Classes: StepContextContext, StepContextInstance, StepContextList, StepContextPage

Instance Method Summary collapse

Constructor Details

#initialize(version, flow_sid, engagement_sid, sid) ⇒ StepContext

Initialize the StepContext

Parameters:

  • version (Version)

    Version that contains the resource

  • flow_sid (String)

    The SID of the Flow with the Step to fetch.

  • engagement_sid (String)

    The SID of the Engagement with the Step to fetch.

  • sid (String)

    The SID of the Step resource to fetch.


159
160
161
162
163
164
165
166
167
168
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 159

def initialize(version, flow_sid, engagement_sid, sid)
  super(version)

  # Path Solution
  @solution = {flow_sid: flow_sid, engagement_sid: engagement_sid, sid: sid, }
  @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:engagement_sid]}/Steps/#{@solution[:sid]}"

  # Dependents
  @step_context = nil
end

Instance Method Details

#fetchStepInstance

Fetch the StepInstance

Returns:


173
174
175
176
177
178
179
180
181
182
183
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 173

def fetch
  payload = @version.fetch('GET', @uri)

  StepInstance.new(
      @version,
      payload,
      flow_sid: @solution[:flow_sid],
      engagement_sid: @solution[:engagement_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


202
203
204
205
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 202

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Studio.V1.StepContext #{context}>"
end

#step_contextStepContextList, StepContextContext

Access the step_context


189
190
191
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 189

def step_context
  StepContextContext.new(@version, @solution[:flow_sid], @solution[:engagement_sid], @solution[:sid], )
end

#to_sObject

Provide a user friendly representation


195
196
197
198
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb', line 195

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Studio.V1.StepContext #{context}>"
end