Class: Twilio::REST::Video::V1::CompositionContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/video/v1/composition.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, sid) ⇒ CompositionContext

Initialize the CompositionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Composition resource to fetch.



276
277
278
279
280
281
282
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 276

def initialize(version, sid)
  super(version)

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

Instance Method Details

#deleteBoolean

Delete the CompositionInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



296
297
298
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 296

def delete
   @version.delete('DELETE', @uri)
end

#fetchCompositionInstance

Fetch the CompositionInstance

Returns:



287
288
289
290
291
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 287

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

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

#inspectObject

Provide a detailed, user friendly representation



309
310
311
312
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 309

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

#to_sObject

Provide a user friendly representation



302
303
304
305
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 302

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