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.



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

def initialize
  reset
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



5
6
7
# File 'lib/bullet/notification_collector.rb', line 5

def collection
  @collection
end

Instance Method Details

#add(value) ⇒ Object



15
16
17
# File 'lib/bullet/notification_collector.rb', line 15

def add( value )
  @collection << value
end

#notifications_present?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/bullet/notification_collector.rb', line 19

def notifications_present?
  !@collection.empty?
end

#resetObject



11
12
13
# File 'lib/bullet/notification_collector.rb', line 11

def reset
  @collection = Set.new
end