Class: SimpleAcp::Models::RunFailedEvent

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

Overview

Run failed 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) ⇒ RunFailedEvent

Returns a new instance of RunFailedEvent.



170
171
172
173
# File 'lib/simple_acp/models/events.rb', line 170

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

Class Method Details

.from_hash(hash) ⇒ Object



175
176
177
178
179
180
181
182
183
# File 'lib/simple_acp/models/events.rb', line 175

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

  instance = super
  if hash["error"] || hash[:error]
    instance.error = Error.from_hash(hash["error"] || hash[:error])
  end
  instance
end