Class: Twilio::REST::Insights::V1::CallContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V1::CallContext
- Defined in:
- lib/twilio-ruby/rest/insights/v1/call.rb,
lib/twilio-ruby/rest/insights/v1/call/event.rb,
lib/twilio-ruby/rest/insights/v1/call/metric.rb,
lib/twilio-ruby/rest/insights/v1/call/annotation.rb,
lib/twilio-ruby/rest/insights/v1/call/call_summary.rb
Defined Under Namespace
Classes: AnnotationContext, AnnotationInstance, AnnotationList, AnnotationPage, CallSummaryContext, CallSummaryInstance, CallSummaryList, CallSummaryPage, EventInstance, EventList, EventPage, MetricInstance, MetricList, MetricPage
Instance Method Summary collapse
-
#annotation ⇒ AnnotationList, AnnotationContext
Access the annotation.
-
#events ⇒ EventList, EventContext
Access the events.
-
#fetch ⇒ CallInstance
Fetch the CallInstance.
-
#initialize(version, sid) ⇒ CallContext
constructor
Initialize the CallContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#metrics ⇒ MetricList, MetricContext
Access the metrics.
-
#summary ⇒ CallSummaryList, CallSummaryContext
Access the summary.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ CallContext
Initialize the CallContext
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 49 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Voice/#{@solution[:sid]}" # Dependents @metrics = nil @events = nil @summary = nil @annotation = nil end |
Instance Method Details
#annotation ⇒ AnnotationList, AnnotationContext
Access the annotation
112 113 114 115 116 117 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 112 def annotation AnnotationContext.new( @version, @solution[:sid] ) end |
#events ⇒ EventList, EventContext
Access the events
91 92 93 94 95 96 97 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 91 def events unless @events @events = EventList.new( @version, call_sid: @solution[:sid], ) end @events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 65 def fetch payload = @version.fetch('GET', @uri) CallInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
128 129 130 131 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 128 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.CallContext #{context}>" end |
#metrics ⇒ MetricList, MetricContext
Access the metrics
80 81 82 83 84 85 86 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 80 def metrics unless @metrics @metrics = MetricList.new( @version, call_sid: @solution[:sid], ) end @metrics end |
#summary ⇒ CallSummaryList, CallSummaryContext
Access the summary
102 103 104 105 106 107 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 102 def summary CallSummaryContext.new( @version, @solution[:sid] ) end |
#to_s ⇒ Object
Provide a user friendly representation
121 122 123 124 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 121 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.CallContext #{context}>" end |