Class: Spree::Admin::MainMenu::Root
- Defined in:
- app/models/spree/admin/main_menu/root.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Attributes inherited from Section
#icon_key, #key, #label_translation_key
Instance Method Summary collapse
- #add_to_section(section_key, item) ⇒ Object
-
#initialize ⇒ Root
constructor
A new instance of Root.
Methods inherited from Section
Methods included from ItemManager
#add, #child_with_key?, #insert_after, #insert_before, #item_for_key, #remove
Constructor Details
#initialize ⇒ Root
Returns a new instance of Root.
7 8 9 |
# File 'app/models/spree/admin/main_menu/root.rb', line 7 def initialize super('root', 'root', nil, [], []) end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'app/models/spree/admin/main_menu/root.rb', line 5 def items @items end |
Instance Method Details
#add_to_section(section_key, item) ⇒ Object
11 12 13 |
# File 'app/models/spree/admin/main_menu/root.rb', line 11 def add_to_section(section_key, item) @items.find { |e| e.key == section_key }.add(item) end |