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.
7 8 9 |
# File 'lib/bullet/notification_collector.rb', line 7 def initialize reset end |
Instance Attribute Details
#collection ⇒ Object (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
19 20 21 |
# File 'lib/bullet/notification_collector.rb', line 19 def notifications_present? !@collection.empty? end |
#reset ⇒ Object
11 12 13 |
# File 'lib/bullet/notification_collector.rb', line 11 def reset @collection = Set.new end |