Class: Bullet::NotificationCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/bullet/notification_collector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNotificationCollector

Returns a new instance of NotificationCollector.



9
10
11
# File 'lib/bullet/notification_collector.rb', line 9

def initialize
  reset
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



7
8
9
# File 'lib/bullet/notification_collector.rb', line 7

def collection
  @collection
end

Instance Method Details

#add(value) ⇒ Object



17
18
19
# File 'lib/bullet/notification_collector.rb', line 17

def add(value)
  @collection << value
end

#notifications_present?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/bullet/notification_collector.rb', line 21

def notifications_present?
  !@collection.empty?
end

#resetObject



13
14
15
# File 'lib/bullet/notification_collector.rb', line 13

def reset
  @collection = Set.new
end