Module: Tekeya::Feed::Notification
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/tekeya/feed/notification.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#read! ⇒ Object
Marks the notification as read.
-
#score(from_time = nil) ⇒ Integer
Approximates the timestamp to the nearest 15 minutes for grouping activities.
Instance Method Details
#read! ⇒ Object
Marks the notification as read
53 54 55 |
# File 'lib/tekeya/feed/notification.rb', line 53 def read! self.update_attribute :read, true end |
#score(from_time = nil) ⇒ Integer
Approximates the timestamp to the nearest 15 minutes for grouping activities
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/tekeya/feed/notification.rb', line 41 def score(from_time = nil) if from_time.present? stamp = from_time.to_i # floors the timestamp to the nearest 15 minute return (stamp.to_f / 15.minutes).floor * 15.minutes else return current_time_from_proper_timezone.to_i end end |