Sha256: 96e3a88d8db7fcefe14027f1581dc8d5ce8a088ed8ffeabcdccdd5ad082e693d

Contents?: true

Size: 633 Bytes

Versions: 8

Compression:

Stored size: 633 Bytes

Contents

module Clockwork

  module DatabaseEvents

    class Manager < Clockwork::Manager

      def unregister(event)
        @events.delete(event)
      end

      def register(period, job, block, options)
        @events << if options[:from_database]
          synchronizer = options.fetch(:synchronizer)
          model_attributes = options.fetch(:model_attributes)

          Clockwork::DatabaseEvents::Event.
            new(self, period, job, (block || handler), synchronizer, model_attributes, options)
        else
          Clockwork::Event.new(self, period, job, block || handler, options)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
clockwork-3.0.2 lib/clockwork/database_events/manager.rb
clockwork-3.0.1 lib/clockwork/database_events/manager.rb
clockwork-3.0.0 lib/clockwork/database_events/manager.rb
clockwork-2.0.4 lib/clockwork/database_events/manager.rb
clockwork-2.0.3 lib/clockwork/database_events/manager.rb
clockwork-2.0.2 lib/clockwork/database_events/manager.rb
clockwork-2.0.1 lib/clockwork/database_events/manager.rb
clockwork-2.0.0 lib/clockwork/database_events/manager.rb