Class: Twilio::REST::Voice::V1::ArchivedCallInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/voice/v1/archived_call.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, date: nil, sid: nil) ⇒ ArchivedCallInstance

Initialize the ArchivedCallInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this ArchivedCall resource.

  • sid (String) (defaults to: nil) —

    The SID of the Call resource to fetch.



196
197
198
199
200
201
202
203
204
# File 'lib/twilio-ruby/rest/voice/v1/archived_call.rb', line 196

def initialize(version , date: nil, sid: nil)
    super(version)
    
    

    # Context
    @instance_context = nil
    @params = { 'date' => date  || @properties['date']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#context ⇒ ArchivedCallContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



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

def context
    unless @instance_context
        @instance_context = ArchivedCallContext.new(@version , @params['date'], @params['sid'])
    end
    @instance_context
end

#delete ⇒ Boolean

Delete the ArchivedCallInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



220
221
222
223
# File 'lib/twilio-ruby/rest/voice/v1/archived_call.rb', line 220

def delete

    context.delete
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



234
235
236
237
# File 'lib/twilio-ruby/rest/voice/v1/archived_call.rb', line 234

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Voice.V1.ArchivedCallInstance #{values}>"
end

#to_s ⇒ Object

Provide a user friendly representation



227
228
229
230
# File 'lib/twilio-ruby/rest/voice/v1/archived_call.rb', line 227

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Voice.V1.ArchivedCallInstance #{values}>"
end