Class: Kitsune::Kit::Events::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/kitsune/kit/events.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(type, run_id:, time: Time.now.utc, **data) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/kitsune/kit/events.rb', line 12

def self.build(type, run_id:, time: Time.now.utc, **data)
  new(
    id: SecureRandom.uuid,
    type: type.to_s,
    time: time.iso8601(6),
    run_id: run_id,
    data: data.freeze
  )
end

Instance Method Details

#to_hObject



22
23
24
# File 'lib/kitsune/kit/events.rb', line 22

def to_h
  { schema_version: SCHEMA_VERSION, id: id, type: type, time: time, run_id: run_id, data: data }
end