Class: Twilio::REST::Studio::V2::FlowContext::FlowRevisionContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid, revision) ⇒ FlowRevisionContext

Initialize the FlowRevisionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Flow resource to fetch.

  • revision (String)

    Specific Revision number or can be `LatestPublished` and `LatestRevision`.


153
154
155
156
157
158
159
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 153

def initialize(version, sid, revision)
  super(version)

  # Path Solution
  @solution = {sid: sid, revision: revision, }
  @uri = "/Flows/#{@solution[:sid]}/Revisions/#{@solution[:revision]}"
end

Instance Method Details

#fetchFlowRevisionInstance

Fetch the FlowRevisionInstance

Returns:


164
165
166
167
168
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 164

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

  FlowRevisionInstance.new(@version, payload, sid: @solution[:sid], revision: @solution[:revision], )
end

#inspectObject

Provide a detailed, user friendly representation


179
180
181
182
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 179

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

#to_sObject

Provide a user friendly representation


172
173
174
175
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 172

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