Sha256: 3e1288f58bccc3c448ed0990f4cf80336ae6d4802fa62c97ee001a61544cf3a9

Contents?: true

Size: 340 Bytes

Versions: 31

Compression:

Stored size: 340 Bytes

Contents

# frozen_string_literal: true

require 'set'

module Bullet
  class NotificationCollector
    attr_reader :collection

    def initialize
      reset
    end

    def reset
      @collection = Set.new
    end

    def add(value)
      @collection << value
    end

    def notifications_present?
      !@collection.empty?
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
bullet-8.0.0 lib/bullet/notification_collector.rb
bullet-7.2.0 lib/bullet/notification_collector.rb
bullet-7.1.6 lib/bullet/notification_collector.rb
bullet-7.1.5 lib/bullet/notification_collector.rb
bullet-7.1.4 lib/bullet/notification_collector.rb
bullet-7.1.3 lib/bullet/notification_collector.rb
bullet-7.1.2 lib/bullet/notification_collector.rb
bullet-7.1.1 lib/bullet/notification_collector.rb
bullet-7.1.0 lib/bullet/notification_collector.rb
bullet-7.0.7 lib/bullet/notification_collector.rb
bullet-7.0.6 lib/bullet/notification_collector.rb
bullet-7.0.5 lib/bullet/notification_collector.rb
bullet-7.0.4 lib/bullet/notification_collector.rb
bullet-7.0.3 lib/bullet/notification_collector.rb
bullet-7.0.2 lib/bullet/notification_collector.rb
bullet-7.0.1 lib/bullet/notification_collector.rb
bullet-7.0.0 lib/bullet/notification_collector.rb
bullet-6.1.5 lib/bullet/notification_collector.rb
bullet-6.1.4 lib/bullet/notification_collector.rb
bullet-6.1.3 lib/bullet/notification_collector.rb