Class: Twilio::REST::Studio::V1::FlowContext::ExecutionContext::ExecutionStepContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb,
lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb

Defined Under Namespace

Classes: ExecutionStepContextContext, ExecutionStepContextInstance, ExecutionStepContextList, ExecutionStepContextPage

Instance Method Summary collapse

Constructor Details

#initialize(version, flow_sid, execution_sid, sid) ⇒ ExecutionStepContext

Initialize the ExecutionStepContext

Parameters:

  • version (Version)

    Version that contains the resource

  • flow_sid (String)

    The SID of the Flow with the Step to fetch.

  • execution_sid (String)

    The SID of the Execution resource with the Step to fetch.

  • sid (String)

    The SID of the ExecutionStep resource to fetch.



138
139
140
141
142
143
144
145
146
147
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb', line 138

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

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

    # Dependents
    @step_context = nil
end

Instance Method Details

#fetchExecutionStepInstance

Fetch the ExecutionStepInstance

Returns:



151
152
153
154
155
156
157
158
159
160
161
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb', line 151

def fetch

    payload = @version.fetch('GET', @uri)
    ExecutionStepInstance.new(
        @version,
        payload,
        flow_sid: @solution[:flow_sid],
        execution_sid: @solution[:execution_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



185
186
187
188
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb', line 185

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

#step_contextExecutionStepContextList, ExecutionStepContextContext

Access the step_context



167
168
169
170
171
172
173
174
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb', line 167

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

#to_sObject

Provide a user friendly representation



178
179
180
181
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb', line 178

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