Class: Notifiable::NotificationStatus
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Notifiable::NotificationStatus
- Defined in:
- lib/notifiable/notification_status.rb
Constant Summary collapse
- REJECTED_STATUS =
1
- SENT_STATUS =
2
- DELIVERED_STATUS =
3
- OPENED_STATUS =
4
Instance Method Summary collapse
- #delivered! ⇒ Object
- #delivered? ⇒ Boolean
- #opened! ⇒ Object
- #opened? ⇒ Boolean
- #rejected! ⇒ Object
- #sent! ⇒ Object
Instance Method Details
#delivered! ⇒ Object
26 27 28 |
# File 'lib/notifiable/notification_status.rb', line 26 def delivered! update_attributes(status: DELIVERED_STATUS) end |
#delivered? ⇒ Boolean
30 31 32 |
# File 'lib/notifiable/notification_status.rb', line 30 def delivered? status == DELIVERED_STATUS end |
#opened! ⇒ Object
34 35 36 |
# File 'lib/notifiable/notification_status.rb', line 34 def opened! update_attributes(status: OPENED_STATUS) end |
#opened? ⇒ Boolean
38 39 40 |
# File 'lib/notifiable/notification_status.rb', line 38 def opened? status == OPENED_STATUS end |
#rejected! ⇒ Object
18 19 20 |
# File 'lib/notifiable/notification_status.rb', line 18 def rejected! update_attributes(status: REJECTED_STATUS) end |
#sent! ⇒ Object
22 23 24 |
# File 'lib/notifiable/notification_status.rb', line 22 def sent! update_attributes(status: SENT_STATUS) end |