Class: RDialogy::Menu

Inherits:
Base
  • Object
show all
Defined in:
lib/rdialogy/menu.rb

Class Method Summary collapse

Class Method Details

.args(options = {}) ⇒ Object



16
17
18
19
20
# File 'lib/rdialogy/menu.rb', line 16

def self.args(options={})
  options[:items] ||= []
  options[:list_height] ||= options[:items].count
  super + [options[:list_height]] + options[:items].map{|e| [e.tag, e.item] }.flatten
end

.commandObject



12
13
14
# File 'lib/rdialogy/menu.rb', line 12

def self.command
  'menu'
end

.run(options = {}) ⇒ Object



6
7
8
9
10
# File 'lib/rdialogy/menu.rb', line 6

def self.run(options={})
  super options, true do |input|
    input.chomp
  end
end