Class: Conreality::Message

Inherits:
Database::Row show all
Defined in:
lib/conreality/message.rb

Overview

Represents a Conreality message.

Constant Summary collapse

TABLE =
:message
KEY =
:id

Constants inherited from Database::Row

Database::Row::SCHEMA

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Database::Row

attr_accessor, attr_reader, attr_wrapper, attr_writer, #get, #key, key_attr, #set!, table_name

Constructor Details

#initialize(client, id) ⇒ Message


43
44
45
46
# File 'lib/conreality/message.rb', line 43

def initialize(client, id)
  super(client)
  @id = id.to_i
end

Instance Attribute Details

#audioBinary (readonly)

The message's contents as audio.


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

def audio
  @audio
end

#idInteger (readonly)

The message's sequential identifier.


12
13
14
# File 'lib/conreality/message.rb', line 12

def id
  @id
end

#senderPlayer, Asset (readonly)

The sender of the message.


24
25
26
# File 'lib/conreality/message.rb', line 24

def sender
  @sender
end

#textString (readonly)

The message's contents as text.


31
32
33
# File 'lib/conreality/message.rb', line 31

def text
  @text
end

#timestampTime (readonly)

The message's timestamp (in Zulu time).


18
19
20
# File 'lib/conreality/message.rb', line 18

def timestamp
  @timestamp
end

Instance Method Details

#inspectString

Returns a developer-friendly representation of this message.


52
53
54
# File 'lib/conreality/message.rb', line 52

def inspect
  sprintf("#<%s:%#0x(id: %s)>", self.class.name, self.__id__, @id)
end