Class: SignalWire::Relay::RecordEvent
- Inherits:
-
RelayEvent
- Object
- RelayEvent
- SignalWire::Relay::RecordEvent
- Defined in:
- lib/signalwire/relay/relay_event.rb
Overview
calling.call.record
Instance Attribute Summary collapse
-
#control_id ⇒ Object
readonly
Returns the value of attribute control_id.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from RelayEvent
#call_id, #event_type, #params, #timestamp
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(control_id: '', state: '', url: '', duration: 0.0, size: 0, record: {}, **base) ⇒ RecordEvent
constructor
A new instance of RecordEvent.
Constructor Details
#initialize(control_id: '', state: '', url: '', duration: 0.0, size: 0, record: {}, **base) ⇒ RecordEvent
Returns a new instance of RecordEvent.
133 134 135 136 137 138 139 140 141 |
# File 'lib/signalwire/relay/relay_event.rb', line 133 def initialize(control_id: '', state: '', url: '', duration: 0.0, size: 0, record: {}, **base) super(**base) @control_id = control_id @state = state @url = url @duration = duration @size = size @record = record end |
Instance Attribute Details
#control_id ⇒ Object (readonly)
Returns the value of attribute control_id.
115 116 117 |
# File 'lib/signalwire/relay/relay_event.rb', line 115 def control_id @control_id end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
115 116 117 |
# File 'lib/signalwire/relay/relay_event.rb', line 115 def duration @duration end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
115 116 117 |
# File 'lib/signalwire/relay/relay_event.rb', line 115 def record @record end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
115 116 117 |
# File 'lib/signalwire/relay/relay_event.rb', line 115 def size @size end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
115 116 117 |
# File 'lib/signalwire/relay/relay_event.rb', line 115 def state @state end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
115 116 117 |
# File 'lib/signalwire/relay/relay_event.rb', line 115 def url @url end |
Class Method Details
.from_payload(payload) ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/signalwire/relay/relay_event.rb', line 117 def self.from_payload(payload) base = RelayEvent.from_payload(payload) p = base.params rec = p['record'] || {} new( event_type: base.event_type, params: base.params, call_id: base.call_id, timestamp: base., control_id: p['control_id'] || '', state: p['state'] || '', url: rec['url'] || p['url'] || '', duration: rec['duration'] || p['duration'] || 0.0, size: rec['size'] || p['size'] || 0, record: rec ) end |