Module: Lokap::Trackable::Activity
- Defined in:
- lib/lokap/trackable/activity.rb
Instance Method Summary collapse
- #actor_name ⇒ Object
- #event_to_s ⇒ Object (also: #event_name)
- #to_s ⇒ Object
Instance Method Details
#actor_name ⇒ Object
4 5 6 |
# File 'lib/lokap/trackable/activity.rb', line 4 def actor_name actor ? actor.name : 'n/a' end |
#event_to_s ⇒ Object Also known as: event_name
12 13 14 |
# File 'lib/lokap/trackable/activity.rb', line 12 def event_to_s event.split('.').last.titleize end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/lokap/trackable/activity.rb', line 8 def to_s "#{created_at.strftime('%m/%d/%Y %l:%M%P')} - #{event_to_s} by #{actor_name}" end |