Class: MeshChat::Message::Relay

Inherits:
Base
  • Object
show all
Defined in:
lib/meshchat/message/relay.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, #render, #type

Constructor Details

#initialize(message: nil, sender_name: nil, sender_location: nil, sender_uid: nil, time_recieved: nil, payload: nil, destination: '', hops: []) ⇒ Relay

Returns a new instance of Relay.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/meshchat/message/relay.rb', line 4

def initialize(
  message: nil,
  sender_name: nil,
  sender_location: nil,
  sender_uid: nil,
  time_recieved: nil,
  payload: nil,
  destination: '',
  hops: [])

  # package the original message
  message = {
    message: message,
    destination: destination,
    hops: hops
  }

  super(
    message: message,
    sender_name: sender_name,
    sender_location: sender_location,
    sender_uid: sender_uid,
    time_recieved: time_recieved,
    payload: payload)
end

Instance Method Details

#displayObject



30
# File 'lib/meshchat/message/relay.rb', line 30

def display; end

#handleObject



32
33
34
35
# File 'lib/meshchat/message/relay.rb', line 32

def handle
  respond
  return
end

#respondObject



37
38
39
# File 'lib/meshchat/message/relay.rb', line 37

def respond

end