Class: SignalWire::Relay::HoldEvent

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

Overview

calling.call.hold

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) ⇒ HoldEvent

Returns a new instance of HoldEvent.



500
501
502
503
# File 'lib/signalwire/relay/relay_event.rb', line 500

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

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



488
489
490
# File 'lib/signalwire/relay/relay_event.rb', line 488

def state
  @state
end

Class Method Details

.from_payload(payload) ⇒ Object



490
491
492
493
494
495
496
497
498
# File 'lib/signalwire/relay/relay_event.rb', line 490

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