Class: Satis::Menu::Component

Inherits:
ApplicationComponent show all
Defined in:
app/components/satis/menu/component.rb

Instance Attribute Summary collapse

Attributes inherited from ApplicationComponent

#original_view_context

Instance Method Summary collapse

Methods inherited from ApplicationComponent

add_helper, #component_name

Constructor Details

#initialize(menu, icon: nil, icon_id: nil, strategy: "fixed") ⇒ Component

Returns a new instance of Component.



9
10
11
12
13
14
15
# File 'app/components/satis/menu/component.rb', line 9

def initialize(menu, icon: nil, icon_id: nil, strategy: "fixed")
  super
  @menu = menu
  @icon = icon || "fa-solid fa-ellipsis"
  @icon_id = icon_id
  @strategy = strategy
end

Instance Attribute Details

#iconObject (readonly)

renders_many :tabs, Tab::Component



7
8
9
# File 'app/components/satis/menu/component.rb', line 7

def icon
  @icon
end

#icon_idObject (readonly)

renders_many :tabs, Tab::Component



7
8
9
# File 'app/components/satis/menu/component.rb', line 7

def icon_id
  @icon_id
end

renders_many :tabs, Tab::Component



7
8
9
# File 'app/components/satis/menu/component.rb', line 7

def menu
  @menu
end

#strategyObject (readonly)

renders_many :tabs, Tab::Component



7
8
9
# File 'app/components/satis/menu/component.rb', line 7

def strategy
  @strategy
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/components/satis/menu/component.rb', line 17

def render?
  menu.items.present?
end