Class: SimpleAcp::Models::RunAwaitingEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/simple_acp/models/events.rb

Overview

Run awaiting event

Instance Attribute Summary

Attributes inherited from Event

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Event

#sse_format

Methods inherited from Base

#==, attribute, attributes, #hash, own_attributes, #to_h, #to_json

Constructor Details

#initialize(**kwargs) ⇒ RunAwaitingEvent

Returns a new instance of RunAwaitingEvent.



119
120
121
122
# File 'lib/simple_acp/models/events.rb', line 119

def initialize(**kwargs)
  kwargs[:type] = Types::EventType::RUN_AWAITING
  super
end

Class Method Details

.from_hash(hash) ⇒ Object



124
125
126
127
128
129
130
131
132
# File 'lib/simple_acp/models/events.rb', line 124

def self.from_hash(hash)
  return nil if hash.nil?

  instance = super
  if hash["await_request"] || hash[:await_request]
    instance.await_request = AwaitRequest.from_hash(hash["await_request"] || hash[:await_request])
  end
  instance
end