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
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.
-
#parent ⇒ Object
Returns the value of attribute parent.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
22 23 24 |
# File 'app/models/katalyst/content/item.rb', line 22 def children @children end |
#depth ⇒ Object
Returns the value of attribute depth.
22 23 24 |
# File 'app/models/katalyst/content/item.rb', line 22 def depth @depth end |
#index ⇒ Object
Returns the value of attribute index.
22 23 24 |
# File 'app/models/katalyst/content/item.rb', line 22 def index @index end |
#parent ⇒ Object
Returns the value of attribute parent.
22 23 24 |
# File 'app/models/katalyst/content/item.rb', line 22 def parent @parent end |
Class Method Details
.config ⇒ Object
7 8 9 |
# File 'app/models/katalyst/content/item.rb', line 7 def self.config Katalyst::Content.config end |
.permitted_params ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/katalyst/content/item.rb', line 24 def self.permitted_params %i[ container_type container_id type heading heading_style background visible ] end |
Instance Method Details
#heading_style_class ⇒ Object
44 45 46 |
# File 'app/models/katalyst/content/item.rb', line 44 def heading_style_class heading_style unless heading_default? end |
#layout? ⇒ Boolean
48 49 50 |
# File 'app/models/katalyst/content/item.rb', line 48 def layout? is_a? Layout end |
#show_heading? ⇒ Boolean
40 41 42 |
# File 'app/models/katalyst/content/item.rb', line 40 def show_heading? !heading_none? end |
#to_plain_text ⇒ Object
36 37 38 |
# File 'app/models/katalyst/content/item.rb', line 36 def to_plain_text heading if show_heading? && visible? end |