Class: SignalWire::Relay::EchoEvent

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

Overview

calling.call.echo

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

Returns a new instance of EchoEvent.



449
450
451
452
# File 'lib/signalwire/relay/relay_event.rb', line 449

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

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



437
438
439
# File 'lib/signalwire/relay/relay_event.rb', line 437

def state
  @state
end

Class Method Details

.from_payload(payload) ⇒ Object



439
440
441
442
443
444
445
446
447
# File 'lib/signalwire/relay/relay_event.rb', line 439

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