Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext::StepContext::StepContextContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Studio::V1::FlowContext::EngagementContext::StepContext::StepContextContext
- Defined in:
- lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb
Instance Method Summary collapse
-
#fetch ⇒ StepContextInstance
Fetch the StepContextInstance.
-
#fetch_with_metadata ⇒ StepContextInstance
Fetch the StepContextInstanceMetadata.
-
#initialize(version, flow_sid, engagement_sid, step_sid) ⇒ StepContextContext
constructor
Initialize the StepContextContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, flow_sid, engagement_sid, step_sid) ⇒ StepContextContext
Initialize the StepContextContext
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 56 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
#fetch ⇒ StepContextInstance
Fetch the StepContextInstance
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 69 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) StepContextInstance.new( @version, payload, flow_sid: @solution[:flow_sid], engagement_sid: @solution[:engagement_sid], step_sid: @solution[:step_sid], ) end |
#fetch_with_metadata ⇒ StepContextInstance
Fetch the StepContextInstanceMetadata
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 90 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) step_context_instance = StepContextInstance.new( @version, response.body, flow_sid: @solution[:flow_sid], engagement_sid: @solution[:engagement_sid], step_sid: @solution[:step_sid], ) StepContextInstanceMetadata.new( @version, step_context_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
124 125 126 127 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 124 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.StepContextContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
117 118 119 120 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb', line 117 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.StepContextContext #{context}>" end |