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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, flow_sid, engagement_sid) ⇒ EngagementContextContext

Initialize the EngagementContextContext

Parameters:

  • version (Version)

    Version that contains the resource

  • flow_sid (String)

    The SID of the Flow.

  • engagement_sid (String)

    The SID of the Engagement.


77
78
79
80
81
82
83
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 77

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

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

Instance Method Details

#fetchEngagementContextInstance

Fetch the EngagementContextInstance

Returns:


88
89
90
91
92
93
94
95
96
97
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 88

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

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

#inspectObject

Provide a detailed, user friendly representation


108
109
110
111
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 108

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

#to_sObject

Provide a user friendly representation


101
102
103
104
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 101

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