Class: Jav::Sidebar::BaseItemComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Jav::Sidebar::BaseItemComponent
- Defined in:
- app/components/jav/sidebar/base_item_component.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Instance Method Summary collapse
-
#initialize(item: nil) ⇒ BaseItemComponent
constructor
A new instance of BaseItemComponent.
- #key ⇒ Object
Constructor Details
#initialize(item: nil) ⇒ BaseItemComponent
Returns a new instance of BaseItemComponent.
6 7 8 |
# File 'app/components/jav/sidebar/base_item_component.rb', line 6 def initialize(item: nil) @item = item end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
4 5 6 |
# File 'app/components/jav/sidebar/base_item_component.rb', line 4 def item @item end |
Instance Method Details
#key ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/components/jav/sidebar/base_item_component.rb', line 12 def key result = "jav.#{request.host}.main_menu.#{item.name.to_s.underscore}" result += ".#{item.icon.parameterize.underscore}" if item.icon.present? result end |