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

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

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 flow_sid

  • engagement_sid (String)

    The engagement_sid

  • sid (String)

    The sid



165
166
167
168
169
170
171
# File 'lib/twilio-ruby/rest/preview/studio/flow/engagement/step.rb', line 165

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]}"
end

Instance Method Details

#fetchStepInstance

Fetch a StepInstance

Returns:



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/twilio-ruby/rest/preview/studio/flow/engagement/step.rb', line 176

def fetch
  params = Twilio::Values.of({})

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

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

#to_sObject

Provide a user friendly representation



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

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