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
38 39 40 41 42 43 |
# File 'lib/cline/notification.rb', line 38 def clean(pool_size) order('notified_at DESC'). order(:display_count). offset(pool_size). destroy_all end |
.display(offset) ⇒ Object
30 31 32 |
# File 'lib/cline/notification.rb', line 30 def display(offset) earliest(1, offset).first.display end |
.normalize_message(m) ⇒ Object
34 35 36 |
# File 'lib/cline/notification.rb', line 34 def (m) m.gsub(/[\r\n]/, '') end |
Instance Method Details
#display ⇒ Object
46 47 48 49 50 |
# File 'lib/cline/notification.rb', line 46 def display Cline.out_stream.puts increment! :display_count end |
#display_message ⇒ Object
52 53 54 |
# File 'lib/cline/notification.rb', line 52 def "[#{notified_at}][#{display_count}] #{}" end |
#message=(m) ⇒ Object
25 26 27 |
# File 'lib/cline/notification.rb', line 25 def (m) super Notification.(m) end |