class Twilio::REST::Insights::V1::CallContext

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 help@twilio.com.

Public Class Methods

new(version, sid) click to toggle source

Initialize the CallContext @param [Version] version Version that contains the resource @param [String] sid The sid @return [CallContext] CallContext

Calls superclass method Twilio::REST::InstanceContext::new
   # File lib/twilio-ruby/rest/insights/v1/call.rb
73 def initialize(version, sid)
74   super(version)
75 
76   # Path Solution
77   @solution = {sid: sid, }
78   @uri = "/Voice/#{@solution[:sid]}"
79 
80   # Dependents
81   @events = nil
82   @metrics = nil
83   @summary = nil
84 end

Public Instance Methods

events() click to toggle source

Access the events @return [EventList] @return [EventContext]

    # File lib/twilio-ruby/rest/insights/v1/call.rb
 99 def events
100   unless @events
101     @events = EventList.new(@version, call_sid: @solution[:sid], )
102   end
103 
104   @events
105 end
fetch() click to toggle source

Fetch the CallInstance @return [CallInstance] Fetched CallInstance

   # File lib/twilio-ruby/rest/insights/v1/call.rb
89 def fetch
90   payload = @version.fetch('GET', @uri)
91 
92   CallInstance.new(@version, payload, sid: @solution[:sid], )
93 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/insights/v1/call.rb
136 def inspect
137   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
138   "#<Twilio.Insights.V1.CallContext #{context}>"
139 end
metrics() click to toggle source

Access the metrics @return [MetricList] @return [MetricContext]

    # File lib/twilio-ruby/rest/insights/v1/call.rb
111 def metrics
112   unless @metrics
113     @metrics = MetricList.new(@version, call_sid: @solution[:sid], )
114   end
115 
116   @metrics
117 end
summary() click to toggle source

Access the summary @return [CallSummaryList] @return [CallSummaryContext]

    # File lib/twilio-ruby/rest/insights/v1/call.rb
123 def summary
124   CallSummaryContext.new(@version, @solution[:sid], )
125 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/insights/v1/call.rb
129 def to_s
130   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
131   "#<Twilio.Insights.V1.CallContext #{context}>"
132 end