Sha256: c605367a475711dd7f669e127e8ac67eab316745b434b3ba46def35adff5dbcc

Contents?: true

Size: 420 Bytes

Versions: 1

Compression:

Stored size: 420 Bytes

Contents

module RooOnRails
  module Routemaster
    module Publishers
      @publishers = {}

      def self.register(publisher_class, model_class:)
        @publishers[model_class] ||= Set.new
        @publishers[model_class] << publisher_class
      end

      def self.for(model, event)
        publisher_classes = @publishers[model.class]
        publisher_classes.map { |c| c.new(model, event) }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roo_on_rails-1.9.0 lib/roo_on_rails/routemaster/publishers.rb