Class: MeshChat::Message::Disconnection

Inherits:
Base
  • Object
show all
Defined in:
lib/meshchat/message/disconnection.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



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

def display
  location = payload['sender']['location']
  name = payload['sender']['alias']
  node = Node.find_by_location(location)
  node.update(online: false) if node
  "#{name}@#{location} has disconnected"
end