Class: SBF::Client::Page
- Inherits:
-
TopLevelEntity
- Object
- BaseEntity
- TopLevelEntity
- SBF::Client::Page
- Includes:
- Entities::DefaultCacheable
- Defined in:
- lib/stbaldricks/entities/page.rb
Defined Under Namespace
Classes: Content
Constant Summary
Constants inherited from TopLevelEntity
TopLevelEntity::DEFAULT_CLASS_ACTIONS, TopLevelEntity::DEFAULT_CRUD_ACTIONS, TopLevelEntity::DEFAULT_ENDPOINT, TopLevelEntity::DEFAULT_INSTANCE_ACTIONS
Constants inherited from BaseEntity
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#locked_at ⇒ Object
Returns the value of attribute locked_at.
-
#locked_by_profile_id ⇒ Object
Returns the value of attribute locked_by_profile_id.
-
#lookup ⇒ Object
Returns the value of attribute lookup.
-
#may_edit ⇒ Object
readonly
Returns the value of attribute may_edit.
-
#title ⇒ Object
Returns the value of attribute title.
-
#title_tag ⇒ Object
Returns the value of attribute title_tag.
Attributes inherited from BaseEntity
Instance Method Summary collapse
Methods included from Entities::DefaultCacheable
Methods inherited from TopLevelEntity
_endpoint, action, actions, blacklist_action, class_action, define_endpoint, endpoint, #endpoint, instance_action
Methods included from Entities::Cacheable
Methods inherited from BaseEntity
#add_errors, allow_instantiation?, attr_accessor, attr_reader, attr_writer, attributes, #attributes=, collection_attributes, entity_attr_accessor, entity_attr_reader, entity_attr_writer, entity_attributes, entity_collection_attr_accessor, entity_collection_attr_reader, entity_collection_attr_writer, inherited, #initialize, #keys_data, #model_name, multitype_attr_accessor, multitype_attr_reader, multitype_attr_writer, multitype_collection_attr_accessor, multitype_collection_attr_reader, multitype_collection_attr_writer, #not_provided_attributes, optional_attributes, #persisted?, #reload!, #reload_recursive, #rollback!, #to_hash, #to_json, #update_data
Constructor Details
This class inherits a constructor from SBF::Client::BaseEntity
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
26 27 28 |
# File 'lib/stbaldricks/entities/page.rb', line 26 def id @id end |
#locked_at ⇒ Object
Returns the value of attribute locked_at.
31 32 33 |
# File 'lib/stbaldricks/entities/page.rb', line 31 def locked_at @locked_at end |
#locked_by_profile_id ⇒ Object
Returns the value of attribute locked_by_profile_id.
30 31 32 |
# File 'lib/stbaldricks/entities/page.rb', line 30 def locked_by_profile_id @locked_by_profile_id end |
#lookup ⇒ Object
Returns the value of attribute lookup.
28 29 30 |
# File 'lib/stbaldricks/entities/page.rb', line 28 def lookup @lookup end |
#may_edit ⇒ Object (readonly)
Returns the value of attribute may_edit.
32 33 34 |
# File 'lib/stbaldricks/entities/page.rb', line 32 def may_edit @may_edit end |
#title ⇒ Object
Returns the value of attribute title.
27 28 29 |
# File 'lib/stbaldricks/entities/page.rb', line 27 def title @title end |
#title_tag ⇒ Object
Returns the value of attribute title_tag.
29 30 31 |
# File 'lib/stbaldricks/entities/page.rb', line 29 def title_tag @title_tag end |
Instance Method Details
#draft_content ⇒ Object
44 45 46 |
# File 'lib/stbaldricks/entities/page.rb', line 44 def draft_content content.select { |x| x.is_draft == true } end |
#meta_content ⇒ Object
35 36 37 |
# File 'lib/stbaldricks/entities/page.rb', line 35 def content.select { |x| x.type == SBF::Client::Page::Content::Type::META } end |
#published_content ⇒ Object
39 40 41 42 |
# File 'lib/stbaldricks/entities/page.rb', line 39 def published_content # Sort content so meta type is at the bottom. This preserves order for rendering on page content.select { |x| x.is_draft == false }.sort! { |a, b| a.sort_order <=> b.sort_order }.sort! { |a, b| b.type <=> a.type } end |