Module: Lokap::Trackable::Activity

Defined in:
lib/lokap/trackable/activity.rb

Instance Method Summary collapse

Instance Method Details

#actor_nameObject



4
5
6
# File 'lib/lokap/trackable/activity.rb', line 4

def actor_name
  actor ? actor.name : 'n/a'
end

#event_to_sObject 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_sObject



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