Class: Informatics::View::Menu::List

Inherits:
Object
  • Object
show all
Defined in:
lib/informatics/lib/informatics/view/menu/list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#itemsObject

Returns the value of attribute items


5
6
7
# File 'lib/informatics/lib/informatics/view/menu/list.rb', line 5

def items
  @items
end

Instance Method Details

#add_item(options = {}) ⇒ Object


7
8
9
10
11
12
# File 'lib/informatics/lib/informatics/view/menu/list.rb', line 7

def add_item(options = {})
  unless @items
    @items = []
  end
  @items.push Informatics::View::Menu::Item.new(text: options[:text], link: options[:link], method: options[:method], confirm: options[:confirm])
end