class SandthornSequelProjection::EventHandlerCollection

Attributes

handlers[R]

Public Class Methods

new() click to toggle source
# File lib/sandthorn_sequel_projection/event_handler_collection.rb, line 10
def initialize
  @handlers = Set.new
end

Public Instance Methods

define(handler_data) click to toggle source
# File lib/sandthorn_sequel_projection/event_handler_collection.rb, line 14
def define(handler_data)
  @handlers << EventHandler.new(handler_data)
end
handle(projection, events) click to toggle source
# File lib/sandthorn_sequel_projection/event_handler_collection.rb, line 18
def handle(projection, events)
  events.each do |event|
    handlers.each do |handler|
      handler.handle(projection, event)
    end
  end
end