Class: SignalWire::Relay::StreamEvent
- Inherits:
-
RelayEvent
- Object
- RelayEvent
- SignalWire::Relay::StreamEvent
- Defined in:
- lib/signalwire/relay/relay_event.rb
Overview
calling.call.stream
Instance Attribute Summary collapse
-
#control_id ⇒ Object
readonly
Returns the value of attribute control_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#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: '', name: '', **base) ⇒ StreamEvent
constructor
A new instance of StreamEvent.
Constructor Details
#initialize(control_id: '', state: '', url: '', name: '', **base) ⇒ StreamEvent
Returns a new instance of StreamEvent.
279 280 281 282 283 284 285 |
# File 'lib/signalwire/relay/relay_event.rb', line 279 def initialize(control_id: '', state: '', url: '', name: '', **base) super(**base) @control_id = control_id @state = state @url = url @name = name end |
Instance Attribute Details
#control_id ⇒ Object (readonly)
Returns the value of attribute control_id.
264 265 266 |
# File 'lib/signalwire/relay/relay_event.rb', line 264 def control_id @control_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
264 265 266 |
# File 'lib/signalwire/relay/relay_event.rb', line 264 def name @name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
264 265 266 |
# File 'lib/signalwire/relay/relay_event.rb', line 264 def state @state end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
264 265 266 |
# File 'lib/signalwire/relay/relay_event.rb', line 264 def url @url end |
Class Method Details
.from_payload(payload) ⇒ Object
266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/signalwire/relay/relay_event.rb', line 266 def self.from_payload(payload) base = RelayEvent.from_payload(payload) p = base.params 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: p['url'] || '', name: p['name'] || '' ) end |