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
  <<~MSG.gsub '.exit', ''
    ------------------------------------------------------------
    From: #{sender.name}
    To: #{recipient.name}
    Date: #{TZ.utc_to_local(created_at).to_s :db}

    #{content&.chomp}
    ------------------------------------------------------------
  MSG
end