Class | SSHMenu::MenuItem |
In: |
lib/sshmenu.rb
(Git)
|
Parent: | Item |
The SSHMenu::MenuItem is used as a container for the configuration options associated with a sub-menu. The object‘s only properties are the title and the array of child items. Inherits from SSHMenu::Item.
items | [R] | An array of SSHMenu::Item children. |
title | [RW] | The menu title. |
Constructor. Attributes hash should contain ‘title’ and ‘items’ keys. Any other keys will be discarded.
# File lib/sshmenu.rb, line 1700 def initialize(h={}) @type = 'menu' @title = h['title'] || '' @items = [] mapper = ClassMapper.instance item_class = mapper.get_class('app.model.item') (h['items'] || []).each { |h| @items.push item_class.new_from_hash(h) } end