Class: SimpleAcp::Models::RunCompletedEvent

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

Overview

Run completed 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) ⇒ RunCompletedEvent

Returns a new instance of RunCompletedEvent.



139
140
141
142
# File 'lib/simple_acp/models/events.rb', line 139

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

Class Method Details

.from_hash(hash) ⇒ Object



144
145
146
147
148
149
150
151
152
# File 'lib/simple_acp/models/events.rb', line 144

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

  instance = super
  if hash["run"] || hash[:run]
    instance.run = Run.from_hash(hash["run"] || hash[:run])
  end
  instance
end