Class: Whatup::Server::Message

Inherits:
ApplicationRecord show all
Defined in:
lib/whatup/server/models/message.rb

Constant Summary collapse

TZ =

Central time

TZInfo::Timezone.get 'America/Detroit'

Instance Method Summary collapse

Instance Method Details

#to_sObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/whatup/server/models/message.rb', line 15

def to_s
  "    ------------------------------------------------------------\n    From: \#{sender.name}\n    To: \#{recipient.name}\n    Date: \#{TZ.utc_to_local(created_at).to_s :db}\n\n    \#{content&.chomp}\n    ------------------------------------------------------------\n  MSG\nend\n".gsub '.exit', ''