Class: SignalWire::Relay::DetectEvent

Inherits:
RelayEvent
  • Object
show all
Defined in:
lib/signalwire/relay/relay_event.rb

Overview

calling.call.detect

Instance Attribute Summary collapse

Attributes inherited from RelayEvent

#call_id, #event_type, #params, #timestamp

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(control_id: '', detect: {}, **base) ⇒ DetectEvent

Returns a new instance of DetectEvent.



207
208
209
210
211
# File 'lib/signalwire/relay/relay_event.rb', line 207

def initialize(control_id: '', detect: {}, **base)
  super(**base)
  @control_id = control_id
  @detect     = detect
end

Instance Attribute Details

#control_idObject (readonly)

Returns the value of attribute control_id.



194
195
196
# File 'lib/signalwire/relay/relay_event.rb', line 194

def control_id
  @control_id
end

#detectObject (readonly)

Returns the value of attribute detect.



194
195
196
# File 'lib/signalwire/relay/relay_event.rb', line 194

def detect
  @detect
end

Class Method Details

.from_payload(payload) ⇒ Object



196
197
198
199
200
201
202
203
204
205
# File 'lib/signalwire/relay/relay_event.rb', line 196

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.timestamp,
    control_id: p['control_id'] || '',
    detect:     p['detect'] || {}
  )
end