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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, flow_sid, engagement_sid, step_sid) ⇒ StepContextContext

Initialize the StepContextContext

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.

  • step_sid (String)

    The SID of the Step to fetch


81
82
83
84
85
86
87
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 81

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

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

Instance Method Details

#fetchStepContextInstance

Fetch the StepContextInstance

Returns:


92
93
94
95
96
97
98
99
100
101
102
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 92

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

  StepContextInstance.new(
      @version,
      payload,
      flow_sid: @solution[:flow_sid],
      engagement_sid: @solution[:engagement_sid],
      step_sid: @solution[:step_sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


113
114
115
116
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 113

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

#to_sObject

Provide a user friendly representation


106
107
108
109
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 106

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