Class: Satis::SidebarMenuItem::Component
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Satis::SidebarMenuItem::Component
- Defined in:
- app/components/satis/sidebar_menu_item/component.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#menu_options ⇒ Object
readonly
Returns the value of attribute menu_options.
Attributes inherited from ApplicationComponent
Instance Method Summary collapse
- #data_actions ⇒ Object
-
#initialize(**options) ⇒ Component
constructor
renders_many :items.
Methods inherited from ApplicationComponent
Constructor Details
#initialize(**options) ⇒ Component
renders_many :items
10 11 12 13 14 |
# File 'app/components/satis/sidebar_menu_item/component.rb', line 10 def initialize(**) @item = [:item] @menu_options = .fetch(:menu_options, {}) @actions = item.link_attributes.delete(:'data-action') end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
7 8 9 |
# File 'app/components/satis/sidebar_menu_item/component.rb', line 7 def item @item end |
#menu_options ⇒ Object (readonly)
Returns the value of attribute menu_options.
7 8 9 |
# File 'app/components/satis/sidebar_menu_item/component.rb', line 7 def @menu_options end |
Instance Method Details
#data_actions ⇒ Object
16 17 18 |
# File 'app/components/satis/sidebar_menu_item/component.rb', line 16 def data_actions "click->satis-sidebar-menu-item#open #{@actions}" end |