Class: SimpleAcp::Models::RunCreatedEvent

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

Overview

Run created 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) ⇒ RunCreatedEvent

Returns a new instance of RunCreatedEvent.



88
89
90
91
# File 'lib/simple_acp/models/events.rb', line 88

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

Class Method Details

.from_hash(hash) ⇒ Object



93
94
95
96
97
98
99
100
101
# File 'lib/simple_acp/models/events.rb', line 93

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