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-6.1.2 lib/bullet/notification_collector.rb
bullet-6.1.1 lib/bullet/notification_collector.rb
bullet-6.1.0 lib/bullet/notification_collector.rb
bullet-6.0.2 lib/bullet/notification_collector.rb
bullet-6.0.1 lib/bullet/notification_collector.rb
bullet-6.0.0 lib/bullet/notification_collector.rb
bullet-5.9.0 lib/bullet/notification_collector.rb
bullet-5.8.1 lib/bullet/notification_collector.rb
bullet-5.8.0 lib/bullet/notification_collector.rb
bullet-5.7.6 lib/bullet/notification_collector.rb
bullet-5.7.5 lib/bullet/notification_collector.rb