Class: DiasporaFederation::Entities::Message
- Inherits:
-
DiasporaFederation::Entity
- Object
- DiasporaFederation::Entity
- DiasporaFederation::Entities::Message
- 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
-
#author ⇒ String
readonly
The diaspora* ID of the author.
-
#conversation_guid ⇒ String
readonly
Guid of a conversation this message belongs to.
-
#created_at ⇒ Time
readonly
Message creation time.
-
#edited_at ⇒ Time
readonly
The timestamp when the message was edited.
-
#guid ⇒ String
readonly
A random string of at least 16 chars.
-
#text ⇒ String
readonly
Text of the message composed by a user.
Instance Method Summary collapse
-
#to_s ⇒ String
String representation of this object.
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
Constructor Details
This class inherits a constructor from DiasporaFederation::Entity
Instance Attribute Details
#author ⇒ String (readonly)
The diaspora* ID of the author
11 |
# File 'lib/diaspora_federation/entities/message.rb', line 11 property :author, :string, xml_name: :diaspora_handle |
#conversation_guid ⇒ String (readonly)
Guid of a conversation this message belongs to
38 |
# File 'lib/diaspora_federation/entities/message.rb', line 38 property :conversation_guid, :string |
#created_at ⇒ Time (readonly)
Message creation time
27 |
# File 'lib/diaspora_federation/entities/message.rb', line 27 property :created_at, :timestamp, default: -> { Time.now.utc } |
#edited_at ⇒ Time (readonly)
The timestamp when the message was edited
32 |
# File 'lib/diaspora_federation/entities/message.rb', line 32 property :edited_at, :timestamp, optional: true |
#guid ⇒ String (readonly)
A random string of at least 16 chars
17 |
# File 'lib/diaspora_federation/entities/message.rb', line 17 property :guid, :string |
#text ⇒ String (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_s ⇒ String
Returns string representation of this object.
41 42 43 |
# File 'lib/diaspora_federation/entities/message.rb', line 41 def to_s "#{super}:#{conversation_guid}" end |