Class: Katalyst::Navigation::Item

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

Overview

STI base class for menu items (headings, links and buttons)

Direct Known Subclasses

Button, Layout, Link

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



11
12
13
# File 'app/models/katalyst/navigation/item.rb', line 11

def children
  @children
end

#depthObject

Returns the value of attribute depth.



11
12
13
# File 'app/models/katalyst/navigation/item.rb', line 11

def depth
  @depth
end

#indexObject

Returns the value of attribute index.



11
12
13
# File 'app/models/katalyst/navigation/item.rb', line 11

def index
  @index
end

#parentObject

Returns the value of attribute parent.



11
12
13
# File 'app/models/katalyst/navigation/item.rb', line 11

def parent
  @parent
end

Class Method Details

.permitted_paramsObject



13
14
15
16
17
18
19
20
21
# File 'app/models/katalyst/navigation/item.rb', line 13

def self.permitted_params
  i[
    title
    url
    visible
    new_tab
    type
  ]
end

Instance Method Details

#layout?Boolean



23
24
25
# File 'app/models/katalyst/navigation/item.rb', line 23

def layout?
  is_a? Layout
end