Class: Underworld::Dashboard::Models::Menu
- Defined in:
- lib/underworld/dashboard/models/sidebar.rb
Instance Attribute Summary
Attributes inherited from Item
#icon, #members_only, #model, #title, #url
Instance Method Summary collapse
- #add_child(child) ⇒ Object
- #children ⇒ Object
-
#initialize(title, options) ⇒ Menu
constructor
A new instance of Menu.
Methods inherited from Item
Constructor Details
#initialize(title, options) ⇒ Menu
Returns a new instance of Menu.
48 49 50 51 52 53 54 55 56 |
# File 'lib/underworld/dashboard/models/sidebar.rb', line 48 def initialize(title, ) children = .delete :children if children @children = children.map do |child| Item.new(child.delete(:title), child) end end super end |
Instance Method Details
#add_child(child) ⇒ Object
43 44 45 46 |
# File 'lib/underworld/dashboard/models/sidebar.rb', line 43 def add_child(child) @children ||= [] @children << child end |
#children ⇒ Object
39 40 41 |
# File 'lib/underworld/dashboard/models/sidebar.rb', line 39 def children @children || [] end |