Class: SolidusAdmin::Sidebar::Item::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- SolidusAdmin::Sidebar::Item::Component
- Defined in:
- app/components/solidus_admin/sidebar/item/component.rb
Overview
Menu item within a Sidebar
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(item:, fullpath: "#", url_helpers: Struct.new(:spree, :solidus_admin).new(spree, solidus_admin)) ⇒ Component
constructor
A new instance of Component.
- #path ⇒ Object
Constructor Details
#initialize(item:, fullpath: "#", url_helpers: Struct.new(:spree, :solidus_admin).new(spree, solidus_admin)) ⇒ Component
Returns a new instance of Component.
10 11 12 13 14 15 16 17 18 |
# File 'app/components/solidus_admin/sidebar/item/component.rb', line 10 def initialize( item:, fullpath: "#", url_helpers: Struct.new(:spree, :solidus_admin).new(spree, solidus_admin) ) @item = item @url_helpers = url_helpers @fullpath = fullpath end |
Instance Method Details
#active? ⇒ Boolean
24 25 26 |
# File 'app/components/solidus_admin/sidebar/item/component.rb', line 24 def active? @item.active?(@url_helpers, @fullpath) end |
#path ⇒ Object
20 21 22 |
# File 'app/components/solidus_admin/sidebar/item/component.rb', line 20 def path @item.path(@url_helpers) end |