Class: Alchemy::Admin::MainNavigation::Entry

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/alchemy/admin/main_navigation/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item:) ⇒ Entry

Returns a new instance of Entry.



33
34
35
# File 'app/components/alchemy/admin/main_navigation/entry.rb', line 33

def initialize(item:)
  @item = item
end

Instance Attribute Details

#item ⇒ Object (readonly)

Returns the value of attribute item.



31
32
33
# File 'app/components/alchemy/admin/main_navigation/entry.rb', line 31

def item
  @item
end

Instance Method Details

#before_render ⇒ Object



37
38
39
# File 'app/components/alchemy/admin/main_navigation/entry.rb', line 37

def before_render
  item.validate_controller_existence!
end

#render? ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/components/alchemy/admin/main_navigation/entry.rb', line 41

def render?
  item.visible?(helpers)
end