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

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/video/v1/composition.rb

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.


270
271
272
273
274
275
276
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 270

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


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

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

#fetchCompositionInstance

Fetch the CompositionInstance

Returns:


281
282
283
284
285
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 281

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

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

#inspectObject

Provide a detailed, user friendly representation


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

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

#to_sObject

Provide a user friendly representation


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

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