Class: Katalyst::Content::Item
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Katalyst::Content::Item
- Defined in:
- app/models/katalyst/content/item.rb
Overview
STI base class for content items
Constant Summary
Constants included from DuplicatesAttachments
DuplicatesAttachments::DUPLICATORS
Constants included from DuplicatesAssociations
DuplicatesAssociations::DUPLICATORS
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#index ⇒ Object
Returns the value of attribute index.
-
#next_sibling ⇒ Object
Returns the value of attribute next_sibling.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#previous_sibling ⇒ Object
Returns the value of attribute previous_sibling.
Class Method Summary collapse
Instance Method Summary collapse
- #dom_id ⇒ Object
- #heading_style_class ⇒ Object
- #item_type ⇒ Object
- #layout? ⇒ Boolean
- #show_heading? ⇒ Boolean
- #to_plain_text ⇒ Object
Methods included from DuplicatesRichText
Methods included from DuplicatesAttachments
Methods included from DuplicatesAssociations
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
28 29 30 |
# File 'app/models/katalyst/content/item.rb', line 28 def children @children end |
#depth ⇒ Object
Returns the value of attribute depth.
28 29 30 |
# File 'app/models/katalyst/content/item.rb', line 28 def depth @depth end |
#index ⇒ Object
Returns the value of attribute index.
28 29 30 |
# File 'app/models/katalyst/content/item.rb', line 28 def index @index end |
#next_sibling ⇒ Object
Returns the value of attribute next_sibling.
28 29 30 |
# File 'app/models/katalyst/content/item.rb', line 28 def next_sibling @next_sibling end |
#parent ⇒ Object
Returns the value of attribute parent.
28 29 30 |
# File 'app/models/katalyst/content/item.rb', line 28 def parent @parent end |
#previous_sibling ⇒ Object
Returns the value of attribute previous_sibling.
28 29 30 |
# File 'app/models/katalyst/content/item.rb', line 28 def previous_sibling @previous_sibling end |
Class Method Details
.config ⇒ Object
12 13 14 |
# File 'app/models/katalyst/content/item.rb', line 12 def self.config Katalyst::Content.config end |
.permitted_params ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/models/katalyst/content/item.rb', line 30 def self.permitted_params %i[ container_type container_id type heading heading_style theme visible ] end |
Instance Method Details
#dom_id ⇒ Object
58 59 60 |
# File 'app/models/katalyst/content/item.rb', line 58 def dom_id heading&.parameterize end |
#heading_style_class ⇒ Object
50 51 52 |
# File 'app/models/katalyst/content/item.rb', line 50 def heading_style_class heading_style unless heading_default? end |
#item_type ⇒ Object
62 63 64 |
# File 'app/models/katalyst/content/item.rb', line 62 def item_type model_name.param_key end |
#layout? ⇒ Boolean
54 55 56 |
# File 'app/models/katalyst/content/item.rb', line 54 def layout? is_a? Layout end |
#show_heading? ⇒ Boolean
46 47 48 |
# File 'app/models/katalyst/content/item.rb', line 46 def show_heading? !heading_none? end |
#to_plain_text ⇒ Object
42 43 44 |
# File 'app/models/katalyst/content/item.rb', line 42 def to_plain_text heading if show_heading? && visible? end |