Class: RubyEventStore::SRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/spec/event_repository_lint.rb

Class Method Summary collapse

Class Method Details

.new(event_id: SecureRandom.uuid, data: {}, metadata: {}, event_type: "SRecordTestEvent", timestamp: Time.new.utc, valid_at: nil) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ruby_event_store/spec/event_repository_lint.rb', line 4

def self.new(
  event_id:   SecureRandom.uuid,
  data:       {},
  metadata:   {},
  event_type: "SRecordTestEvent",
  timestamp:  Time.new.utc,
  valid_at:   nil
)
  Record.new(
    event_id:   event_id,
    data:       data,
    metadata:   ,
    event_type: event_type,
    timestamp:  timestamp.round(TIMESTAMP_PRECISION),
    valid_at:   (valid_at || timestamp).round(TIMESTAMP_PRECISION),
  )
end