Class: SignalWire::Relay::TapEvent
- Inherits:
-
RelayEvent
- Object
- RelayEvent
- SignalWire::Relay::TapEvent
- Defined in:
- lib/signalwire/relay/relay_event.rb
Overview
calling.call.tap
Instance Attribute Summary collapse
-
#control_id ⇒ Object
readonly
Returns the value of attribute control_id.
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#tap ⇒ Object
readonly
Returns the value of attribute tap.
Attributes inherited from RelayEvent
#call_id, #event_type, #params, #timestamp
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(control_id: '', state: '', tap: {}, device: {}, **base) ⇒ TapEvent
constructor
A new instance of TapEvent.
Constructor Details
#initialize(control_id: '', state: '', tap: {}, device: {}, **base) ⇒ TapEvent
Returns a new instance of TapEvent.
253 254 255 256 257 258 259 |
# File 'lib/signalwire/relay/relay_event.rb', line 253 def initialize(control_id: '', state: '', tap: {}, device: {}, **base) super(**base) @control_id = control_id @state = state @tap = tap @device = device end |
Instance Attribute Details
#control_id ⇒ Object (readonly)
Returns the value of attribute control_id.
238 239 240 |
# File 'lib/signalwire/relay/relay_event.rb', line 238 def control_id @control_id end |
#device ⇒ Object (readonly)
Returns the value of attribute device.
238 239 240 |
# File 'lib/signalwire/relay/relay_event.rb', line 238 def device @device end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
238 239 240 |
# File 'lib/signalwire/relay/relay_event.rb', line 238 def state @state end |
#tap ⇒ Object (readonly)
Returns the value of attribute tap.
238 239 240 |
# File 'lib/signalwire/relay/relay_event.rb', line 238 def tap @tap end |
Class Method Details
.from_payload(payload) ⇒ Object
240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/signalwire/relay/relay_event.rb', line 240 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'] || '', tap: p['tap'] || {}, device: p['device'] || {} ) end |