Sha256: 5667f4826fdd92e7e83c6a83b719b42d18c728cf6e7c84af2dc37404048a74e0

Contents?: true

Size: 309 Bytes

Versions: 4

Compression:

Stored size: 309 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
bullet-5.7.4 lib/bullet/notification_collector.rb
bullet-5.7.3 lib/bullet/notification_collector.rb
bullet-5.7.2 lib/bullet/notification_collector.rb
bullet-5.7.1 lib/bullet/notification_collector.rb