⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

event_helpers.rb 507B

123456789101112131415161718192021222324252627
  1. # frozen_string_literal: true
  2. ##
  3. # Helpers for testing events.
  4. module EventHelpers
  5. def last_event(aggregate_id)
  6. Hours.event_store.get_events_for_aggregate_id(aggregate_id).last
  7. end
  8. def projector_process_event(aggregate_id)
  9. projectors.each do |projector|
  10. projector.process(last_event(aggregate_id))
  11. end
  12. end
  13. def setup_projectors
  14. projectors.each(&:setup)
  15. end
  16. protected
  17. def projectors
  18. @projectors = [
  19. Hours::Projections::Nodes::Projector.new
  20. ]
  21. end
  22. end