Class: MeshChat::Message::Chat

Inherits:
Base
  • Object
show all
Defined in:
lib/meshchat/message/chat.rb

Instance Attribute Summary

Attributes inherited from Base

#message, #payload, #sender_location, #sender_name, #sender_uid, #time_recieved

Instance Method Summary collapse

Methods inherited from Base

#client, #client_version, #handle, #initialize, #render, #respond, #type

Constructor Details

This class inherits a constructor from MeshChat::Message::Base

Instance Method Details

#displayObject



5
6
7
8
9
10
11
# File 'lib/meshchat/message/chat.rb', line 5

def display
  time_recieved = self.time_recieved.strftime('%e/%m/%y %H:%I:%M')
  name = payload['sender']['alias']
  message = payload['message']

  "#{time_recieved} #{name} > #{message}"
end