Class: SignalWire::Relay::DialEvent
- Inherits:
-
RelayEvent
- Object
- RelayEvent
- SignalWire::Relay::DialEvent
- Defined in:
- lib/signalwire/relay/relay_event.rb
Overview
calling.call.dial
Instance Attribute Summary collapse
-
#call_data ⇒ Object
readonly
Returns the value of attribute call_data.
-
#dial_state ⇒ Object
readonly
Returns the value of attribute dial_state.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Attributes inherited from RelayEvent
#call_id, #event_type, #params, #timestamp
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tag: '', dial_state: '', call_data: {}, **base) ⇒ DialEvent
constructor
A new instance of DialEvent.
Constructor Details
#initialize(tag: '', dial_state: '', call_data: {}, **base) ⇒ DialEvent
Returns a new instance of DialEvent.
326 327 328 329 330 331 |
# File 'lib/signalwire/relay/relay_event.rb', line 326 def initialize(tag: '', dial_state: '', call_data: {}, **base) super(**base) @tag = tag @dial_state = dial_state @call_data = call_data end |
Instance Attribute Details
#call_data ⇒ Object (readonly)
Returns the value of attribute call_data.
312 313 314 |
# File 'lib/signalwire/relay/relay_event.rb', line 312 def call_data @call_data end |
#dial_state ⇒ Object (readonly)
Returns the value of attribute dial_state.
312 313 314 |
# File 'lib/signalwire/relay/relay_event.rb', line 312 def dial_state @dial_state end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
312 313 314 |
# File 'lib/signalwire/relay/relay_event.rb', line 312 def tag @tag end |
Class Method Details
.from_payload(payload) ⇒ Object
314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/signalwire/relay/relay_event.rb', line 314 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., tag: p['tag'] || '', dial_state: p['dial_state'] || '', call_data: p['call'] || {} ) end |