Class: SignalWire::Relay::SendDigitsEvent

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

Overview

calling.call.send_digits

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: '', state: '', **base) ⇒ SendDigitsEvent

Returns a new instance of SendDigitsEvent.



303
304
305
306
307
# File 'lib/signalwire/relay/relay_event.rb', line 303

def initialize(control_id: '', state: '', **base)
  super(**base)
  @control_id = control_id
  @state      = state
end

Instance Attribute Details

#control_idObject (readonly)

Returns the value of attribute control_id.



290
291
292
# File 'lib/signalwire/relay/relay_event.rb', line 290

def control_id
  @control_id
end

#stateObject (readonly)

Returns the value of attribute state.



290
291
292
# File 'lib/signalwire/relay/relay_event.rb', line 290

def state
  @state
end

Class Method Details

.from_payload(payload) ⇒ Object



292
293
294
295
296
297
298
299
300
301
# File 'lib/signalwire/relay/relay_event.rb', line 292

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'] || '',
    state:      p['state'] || ''
  )
end