Class: DiasporaFederation::Entities::Message

Inherits:
DiasporaFederation::Entity show all
Defined in:
lib/diaspora_federation/entities/message.rb

Overview

This entity represents a private message exchanged in private conversation.

Constant Summary

Constants inherited from DiasporaFederation::Entity

DiasporaFederation::Entity::ENTITY_NAME_REGEX, DiasporaFederation::Entity::INVALID_XML_REGEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiasporaFederation::Entity

class_name, entity_class, entity_name, from_hash, from_json, from_xml, #initialize, #to_h, #to_json, #to_xml

Methods included from PropertiesDSL

#class_props, #default_values, #entity, #find_property_for_xml_name, #missing_props, #optional_props, #property, #resolv_aliases, #xml_names

Methods included from Logging

included

Constructor Details

This class inherits a constructor from DiasporaFederation::Entity

Instance Attribute Details

#authorString (readonly)

The diaspora* ID of the author

See Also:


11
# File 'lib/diaspora_federation/entities/message.rb', line 11

property :author, :string, xml_name: :diaspora_handle

#conversation_guidString (readonly)

Guid of a conversation this message belongs to

See Also:


33
# File 'lib/diaspora_federation/entities/message.rb', line 33

property :conversation_guid, :string

#created_atTime (readonly)

Message creation time


27
# File 'lib/diaspora_federation/entities/message.rb', line 27

property :created_at, :timestamp, default: -> { Time.now.utc }

#guidString (readonly)

A random string of at least 16 chars


17
# File 'lib/diaspora_federation/entities/message.rb', line 17

property :guid, :string

#textString (readonly)

Text of the message composed by a user


22
# File 'lib/diaspora_federation/entities/message.rb', line 22

property :text, :string

Instance Method Details

#to_sString


36
37
38
# File 'lib/diaspora_federation/entities/message.rb', line 36

def to_s
  "#{super}:#{conversation_guid}"
end