Class: Bullet::NotificationCollector
- Inherits:
-
Object
- Object
- Bullet::NotificationCollector
- Defined in:
- lib/bullet/notification_collector.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
- #add(value) ⇒ Object
-
#initialize ⇒ NotificationCollector
constructor
A new instance of NotificationCollector.
- #notifications_present? ⇒ Boolean
- #reset ⇒ Object
Constructor Details
#initialize ⇒ NotificationCollector
Returns a new instance of NotificationCollector.
9 10 11 |
# File 'lib/bullet/notification_collector.rb', line 9 def initialize reset end |
Instance Attribute Details
#collection ⇒ Object (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
21 22 23 |
# File 'lib/bullet/notification_collector.rb', line 21 def notifications_present? !@collection.empty? end |
#reset ⇒ Object
13 14 15 |
# File 'lib/bullet/notification_collector.rb', line 13 def reset @collection = Set.new end |