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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



18
19
20
# File 'app/models/katalyst/content/item.rb', line 18

def children
  @children
end

#depthObject

Returns the value of attribute depth.



18
19
20
# File 'app/models/katalyst/content/item.rb', line 18

def depth
  @depth
end

#indexObject

Returns the value of attribute index.



18
19
20
# File 'app/models/katalyst/content/item.rb', line 18

def index
  @index
end

#parentObject

Returns the value of attribute parent.



18
19
20
# File 'app/models/katalyst/content/item.rb', line 18

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



20
21
22
23
24
25
26
27
28
29
30
# File 'app/models/katalyst/content/item.rb', line 20

def self.permitted_params
  i[
    container_type
    container_id
    type
    heading
    show_heading
    background
    visible
  ]
end

Instance Method Details

#layout?Boolean

Returns:

  • (Boolean)


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

def layout?
  is_a? Layout
end

#to_plain_textObject



32
33
34
# File 'app/models/katalyst/content/item.rb', line 32

def to_plain_text
  heading if show_heading? && visible?
end