Class: SignalWire::Relay::CallingErrorEvent

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

Overview

calling.error

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(code: '', message: '', **base) ⇒ CallingErrorEvent

Returns a new instance of CallingErrorEvent.



545
546
547
548
549
# File 'lib/signalwire/relay/relay_event.rb', line 545

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



532
533
534
# File 'lib/signalwire/relay/relay_event.rb', line 532

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



532
533
534
# File 'lib/signalwire/relay/relay_event.rb', line 532

def message
  @message
end

Class Method Details

.from_payload(payload) ⇒ Object



534
535
536
537
538
539
540
541
542
543
# File 'lib/signalwire/relay/relay_event.rb', line 534

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