Class: My

Inherits:
Object
  • Object
show all
Includes:
DialogTui
Defined in:
lib/dialog_tui.rb

Constant Summary

Constants included from DialogTui

DialogTui::VERSION

Instance Method Summary collapse

Methods included from DialogTui

dialog

Instance Method Details

#actObject



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/dialog_tui.rb', line 159

def act
  
  dialog {
  
    option '1. hey' do
      puts 'you choose the first one!'
    end
  
    option '2. hi!' do
      puts 'you choose the second one!'
    end
  
    option '3. bye' do
      puts '*waving*'
    end

    ctrl_c do
      puts 'ctrl+c worked!'
      exit 0
    end

  }.
  tap { |result|
    raise unless result.nil?
    # because it works for effect, not for return value
  }
  
end