Class: Katalyst::Content::Item
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Katalyst::Content::Item
show all
- Includes:
- HasStyle
- Defined in:
- app/models/katalyst/content/item.rb
Overview
STI base class for content items
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
24
25
26
|
# File 'app/models/katalyst/content/item.rb', line 24
def children
@children
end
|
#depth ⇒ Object
Returns the value of attribute depth.
24
25
26
|
# File 'app/models/katalyst/content/item.rb', line 24
def depth
@depth
end
|
#index ⇒ Object
Returns the value of attribute index.
24
25
26
|
# File 'app/models/katalyst/content/item.rb', line 24
def index
@index
end
|
#parent ⇒ Object
Returns the value of attribute parent.
24
25
26
|
# File 'app/models/katalyst/content/item.rb', line 24
def parent
@parent
end
|
Class Method Details
.config ⇒ Object
9
10
11
|
# File 'app/models/katalyst/content/item.rb', line 9
def self.config
Katalyst::Content.config
end
|
.permitted_params ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
|
# File 'app/models/katalyst/content/item.rb', line 26
def self.permitted_params
%i[
container_type
container_id
type
heading
heading_style
background
visible
]
end
|
Instance Method Details
#heading_style_class ⇒ Object
46
47
48
|
# File 'app/models/katalyst/content/item.rb', line 46
def heading_style_class
heading_style unless heading_default?
end
|
#layout? ⇒ Boolean
50
51
52
|
# File 'app/models/katalyst/content/item.rb', line 50
def layout?
is_a? Layout
end
|
#show_heading? ⇒ Boolean
42
43
44
|
# File 'app/models/katalyst/content/item.rb', line 42
def show_heading?
!heading_none?
end
|
#to_plain_text ⇒ Object
38
39
40
|
# File 'app/models/katalyst/content/item.rb', line 38
def to_plain_text
heading if show_heading? && visible?
end
|