Class: Cline::Notification
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Cline::Notification
- Defined in:
- lib/cline/notification.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.clean(pool_size) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/cline/notification.rb', line 40 def clean(pool_size) order_by_default_priority_for_display. order('notified_at DESC'). offset(pool_size). destroy_all end |
.display(offset) ⇒ Object
32 33 34 |
# File 'lib/cline/notification.rb', line 32 def display(offset) earliest(1, offset).first.display end |
.normalize_message(m) ⇒ Object
36 37 38 |
# File 'lib/cline/notification.rb', line 36 def (m) m.gsub(/[\r\n]/, '') end |
Instance Method Details
#display ⇒ Object
48 49 50 51 52 |
# File 'lib/cline/notification.rb', line 48 def display Cline.out_stream.puts increment! :display_count end |
#display_message ⇒ Object
54 55 56 |
# File 'lib/cline/notification.rb', line 54 def "[#{notified_at}][#{display_count}] #{}" end |
#message=(m) ⇒ Object
27 28 29 |
# File 'lib/cline/notification.rb', line 27 def (m) super Notification.(m) end |