Class: DiasporaFederation::Entities::Embed
- Inherits:
-
DiasporaFederation::Entity
- Object
- DiasporaFederation::Entity
- DiasporaFederation::Entities::Embed
- Defined in:
- lib/diaspora_federation/entities/embed.rb
Overview
This entity is used to specify embed information about an URL that should be embedded.
Constant Summary
Constants inherited from DiasporaFederation::Entity
DiasporaFederation::Entity::ENTITY_NAME_REGEX, DiasporaFederation::Entity::INVALID_XML_REGEX
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The description of the embedded URL.
-
#image ⇒ String
readonly
The image of the embedded URL.
-
#nothing ⇒ String
readonly
True, if nothing should be embedded.
-
#title ⇒ String
readonly
The title of the embedded URL.
-
#url ⇒ String
readonly
URL that should be embedded.
Instance Method Summary collapse
-
#to_s ⇒ String
String representation of this object.
- #validate ⇒ 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, #missing_props, #optional_props, #property, #resolv_aliases
Methods included from Logging
Constructor Details
This class inherits a constructor from DiasporaFederation::Entity
Instance Attribute Details
#description ⇒ String (readonly)
The description of the embedded URL.
22 |
# File 'lib/diaspora_federation/entities/embed.rb', line 22 property :description, :string, optional: true |
#image ⇒ String (readonly)
The image of the embedded URL.
27 |
# File 'lib/diaspora_federation/entities/embed.rb', line 27 property :image, :string, optional: true |
#nothing ⇒ String (readonly)
True, if nothing should be embedded.
32 |
# File 'lib/diaspora_federation/entities/embed.rb', line 32 property :nothing, :boolean, optional: true |
#title ⇒ String (readonly)
The title of the embedded URL.
17 |
# File 'lib/diaspora_federation/entities/embed.rb', line 17 property :title, :string, optional: true |
#url ⇒ String (readonly)
URL that should be embedded.
12 |
# File 'lib/diaspora_federation/entities/embed.rb', line 12 property :url, :string, optional: true |
Instance Method Details
#to_s ⇒ String
Returns string representation of this object.
35 36 37 |
# File 'lib/diaspora_federation/entities/embed.rb', line 35 def to_s "Embed#{":#{url}" if url}" end |
#validate ⇒ Object
39 40 41 42 43 |
# File 'lib/diaspora_federation/entities/embed.rb', line 39 def validate super raise ValidationError, "Either 'url' must be set or 'nothing' must be 'true'" unless nothing ^ url end |