Class: Twilio::REST::Video::V1::RecordingContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ RecordingContext

Initialize the RecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Recording resource to fetch.


210
211
212
213
214
215
216
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 210

def initialize(version, sid)
  super(version)

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

Instance Method Details

#deleteBoolean

Delete the RecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


230
231
232
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 230

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

#fetchRecordingInstance

Fetch the RecordingInstance

Returns:


221
222
223
224
225
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 221

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

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

#inspectObject

Provide a detailed, user friendly representation


243
244
245
246
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 243

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

#to_sObject

Provide a user friendly representation


236
237
238
239
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 236

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