Class: Avo::Sidebar::BaseItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Avo::Sidebar::BaseItemComponent
show all
- Defined in:
- app/components/avo/sidebar/base_item_component.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseItemComponent.
6
7
8
|
# File 'app/components/avo/sidebar/base_item_component.rb', line 6
def initialize(item: nil)
@item = item
end
|
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
4
5
6
|
# File 'app/components/avo/sidebar/base_item_component.rb', line 4
def item
@item
end
|
Instance Method Details
#collapsable ⇒ Object
24
25
26
|
# File 'app/components/avo/sidebar/base_item_component.rb', line 24
def collapsable
item.collapsable
end
|
#collapsed ⇒ Object
28
29
30
|
# File 'app/components/avo/sidebar/base_item_component.rb', line 28
def collapsed
item.collapsed
end
|
#items ⇒ Object
10
11
12
|
# File 'app/components/avo/sidebar/base_item_component.rb', line 10
def items
item.items
end
|
#key ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'app/components/avo/sidebar/base_item_component.rb', line 14
def key
result = "avo.#{request.host}.main_menu.#{item.name.to_s.underscore}"
if item.icon.present?
result += ".#{item.icon.parameterize.underscore}"
end
result
end
|