Class: SignalWire::Relay::CollectEvent
- Inherits:
-
RelayEvent
- Object
- RelayEvent
- SignalWire::Relay::CollectEvent
- Defined in:
- lib/signalwire/relay/relay_event.rb
Overview
calling.call.collect
Instance Attribute Summary collapse
-
#control_id ⇒ Object
readonly
Returns the value of attribute control_id.
-
#final ⇒ Object
readonly
Returns the value of attribute final.
-
#result_data ⇒ Object
readonly
Returns the value of attribute result_data.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Attributes inherited from RelayEvent
#call_id, #event_type, #params, #timestamp
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(control_id: '', state: '', result_data: {}, final: nil, **base) ⇒ CollectEvent
constructor
A new instance of CollectEvent.
Constructor Details
#initialize(control_id: '', state: '', result_data: {}, final: nil, **base) ⇒ CollectEvent
Returns a new instance of CollectEvent.
161 162 163 164 165 166 167 |
# File 'lib/signalwire/relay/relay_event.rb', line 161 def initialize(control_id: '', state: '', result_data: {}, final: nil, **base) super(**base) @control_id = control_id @state = state @result_data = result_data @final = final end |
Instance Attribute Details
#control_id ⇒ Object (readonly)
Returns the value of attribute control_id.
146 147 148 |
# File 'lib/signalwire/relay/relay_event.rb', line 146 def control_id @control_id end |
#final ⇒ Object (readonly)
Returns the value of attribute final.
146 147 148 |
# File 'lib/signalwire/relay/relay_event.rb', line 146 def final @final end |
#result_data ⇒ Object (readonly)
Returns the value of attribute result_data.
146 147 148 |
# File 'lib/signalwire/relay/relay_event.rb', line 146 def result_data @result_data end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
146 147 148 |
# File 'lib/signalwire/relay/relay_event.rb', line 146 def state @state end |
Class Method Details
.from_payload(payload) ⇒ Object
148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/signalwire/relay/relay_event.rb', line 148 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., control_id: p['control_id'] || '', state: p['state'] || '', result_data: p['result'] || {}, final: p['final'] ) end |