module Menu

Public Class Methods

build(*items) click to toggle source
# File doc/data.in.rb, line 63
def self.build(*items)
  items.reverse_each.reduce(None) { |menu, item| Menu[item, menu] }
end

Public Instance Methods

draw_menu(indent = 0) click to toggle source
# File doc/data.in.rb, line 78
def draw_menu(indent = 0)
  map { |item| item.draw_menu indent }.reduce(&:+)
end
each(&block) click to toggle source
# File doc/data.in.rb, line 69
def each(&block)
  it = self
  loop do
    break if None === it
    block.call it.item
    it = it.next
  end
end