Class: RDialogy::Form

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

Class Method Summary collapse

Class Method Details

.run(options = {}) ⇒ Object

Use up/down arrows (or control/N, control/P) to move between fields. Use tab to move between windows.



32
33
34
35
36
37
38
39
40
41
# File 'lib/rdialogy/form.rb', line 32

def self.run(options={})
    keys = options[:items].map(&:label_text)
  super options, true do |input|
    result = Hash.new
    input.split("\n").each do |item|
      result[keys.shift] = item
    end
    result
  end
end