Module: DiasporaFederation::Entities::Post
- Included in:
- StatusMessage
- Defined in:
- lib/diaspora_federation/entities/post.rb
Overview
This is a module that defines common properties for a post which include StatusMessage and Reshare.
Instance Attribute Summary collapse
-
#author ⇒ String
readonly
The diaspora* ID of the person who posts the post.
-
#created_at ⇒ Time
readonly
Post entity creation time.
-
#guid ⇒ String
readonly
A random string of at least 16 chars.
-
#provider_display_name ⇒ String
readonly
A string that describes a means by which a user has posted the post.
-
#public ⇒ Boolean
readonly
Shows whether the post is visible to everyone or only to some aspects.
Class Method Summary collapse
-
.included(entity) ⇒ Object
On inclusion of this module the required properties for a post are added to the object that includes it.
Instance Attribute Details
#author ⇒ String (readonly)
The diaspora* ID of the person who posts the post
33 34 35 36 37 38 39 40 41 |
# File 'lib/diaspora_federation/entities/post.rb', line 33 def self.included(entity) entity.class_eval do property :author, :string property :guid, :string property :created_at, :timestamp, default: -> { Time.now.utc } property :public, :boolean, default: false property :provider_display_name, :string, optional: true end end |
#created_at ⇒ Time (readonly)
Post entity creation time
33 34 35 36 37 38 39 40 41 |
# File 'lib/diaspora_federation/entities/post.rb', line 33 def self.included(entity) entity.class_eval do property :author, :string property :guid, :string property :created_at, :timestamp, default: -> { Time.now.utc } property :public, :boolean, default: false property :provider_display_name, :string, optional: true end end |
#guid ⇒ String (readonly)
A random string of at least 16 chars
33 34 35 36 37 38 39 40 41 |
# File 'lib/diaspora_federation/entities/post.rb', line 33 def self.included(entity) entity.class_eval do property :author, :string property :guid, :string property :created_at, :timestamp, default: -> { Time.now.utc } property :public, :boolean, default: false property :provider_display_name, :string, optional: true end end |
#provider_display_name ⇒ String (readonly)
A string that describes a means by which a user has posted the post
33 34 35 36 37 38 39 40 41 |
# File 'lib/diaspora_federation/entities/post.rb', line 33 def self.included(entity) entity.class_eval do property :author, :string property :guid, :string property :created_at, :timestamp, default: -> { Time.now.utc } property :public, :boolean, default: false property :provider_display_name, :string, optional: true end end |
#public ⇒ Boolean (readonly)
Shows whether the post is visible to everyone or only to some aspects
33 34 35 36 37 38 39 40 41 |
# File 'lib/diaspora_federation/entities/post.rb', line 33 def self.included(entity) entity.class_eval do property :author, :string property :guid, :string property :created_at, :timestamp, default: -> { Time.now.utc } property :public, :boolean, default: false property :provider_display_name, :string, optional: true end end |
Class Method Details
.included(entity) ⇒ Object
On inclusion of this module the required properties for a post are added to the object that includes it.
33 34 35 36 37 38 39 40 41 |
# File 'lib/diaspora_federation/entities/post.rb', line 33 def self.included(entity) entity.class_eval do property :author, :string property :guid, :string property :created_at, :timestamp, default: -> { Time.now.utc } property :public, :boolean, default: false property :provider_display_name, :string, optional: true end end |