Class: Katalyst::Content::Item

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/katalyst/content/item.rb

Overview

STI base class for content items

Direct Known Subclasses

Content, Figure, Layout, Table

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



22
23
24
# File 'app/models/katalyst/content/item.rb', line 22

def children
  @children
end

#depthObject

Returns the value of attribute depth.



22
23
24
# File 'app/models/katalyst/content/item.rb', line 22

def depth
  @depth
end

#indexObject

Returns the value of attribute index.



22
23
24
# File 'app/models/katalyst/content/item.rb', line 22

def index
  @index
end

#parentObject

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

.configObject



7
8
9
# File 'app/models/katalyst/content/item.rb', line 7

def self.config
  Katalyst::Content.config
end

.permitted_paramsObject



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_classObject



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_textObject



36
37
38
# File 'app/models/katalyst/content/item.rb', line 36

def to_plain_text
  heading if show_heading? && visible?
end