Sha256: f6cef9131a7bef3610fe4356a0a9219447f0e7625cd8d9f959e94c23a953d774

Contents?: true

Size: 579 Bytes

Versions: 6

Compression:

Stored size: 579 Bytes

Contents

module ActiveRecord::Turntable
  class Sequencer
    class Barrage < Sequencer
      class_attribute :unique_barrage_instance
      self.unique_barrage_instance = {}

      def initialize(options = {})
        require "barrage"
        @options = options["options"]
      end

      def next_sequence_value(sequence_name)
        barrage.next
      end

      def current_sequence_value(sequence_name)
        barrage.current
      end

      private

        def barrage
          self.unique_barrage_instance[@options] ||= ::Barrage.new(@options)
        end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerecord-turntable-4.4.1 lib/active_record/turntable/sequencer/barrage.rb
activerecord-turntable-4.4.0 lib/active_record/turntable/sequencer/barrage.rb
activerecord-turntable-4.3.0 lib/active_record/turntable/sequencer/barrage.rb
activerecord-turntable-4.2.0 lib/active_record/turntable/sequencer/barrage.rb
activerecord-turntable-4.1.0 lib/active_record/turntable/sequencer/barrage.rb
activerecord-turntable-4.0.0 lib/active_record/turntable/sequencer/barrage.rb