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, #missing_props, #optional_props, #property, #resolv_aliases

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

Returns:

  • (String)

    diaspora* ID

See Also:



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

property :author, :string

#conversation_guidString (readonly)

Guid of a conversation this message belongs to

Returns:

  • (String)

    conversation guid

See Also:



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

property :conversation_guid, :string

#created_atTime (readonly)

Message creation time

Returns:

  • (Time)

    creation time



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

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

#edited_atTime (readonly)

The timestamp when the message was edited

Returns:

  • (Time)

    edited time



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

property :edited_at, :timestamp, optional: true

#guidString (readonly)

A random string of at least 16 chars

Returns:

  • (String)

    guid

See Also:



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

property :guid, :string

#textString (readonly)

Text of the message composed by a user

Returns:

  • (String)

    text



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

property :text, :string

Instance Method Details

#to_sString

Returns string representation of this object.

Returns:

  • (String)

    string representation of this object



43
44
45
# File 'lib/diaspora_federation/entities/message.rb', line 43

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