arkency/rails_event_store

View on GitHub
support/helpers/time_enrichment.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module TimeEnrichment
  def with(event, timestamp: Time.now.utc, valid_at: nil)
    event.metadata[:timestamp] ||= timestamp
    event.metadata[:valid_at] ||= valid_at || timestamp
    event
  end
  module_function :with
end