Class: DevSystem::HighlineInputCommand

Inherits:
InputCommand show all
Defined in:
lib/dev_system/sub/command/input_commands/highline_input_command.rb

Class Method Summary collapse

Methods inherited from InputCommand

call

Methods inherited from Command

call, #call, get_command_signatures

Methods inherited from Liza::Controller

color, inherited, on_connected

Methods inherited from Liza::Unit

const_missing, division, part, system, #system, test_class

Class Method Details

.highlineObject



3
4
5
6
# File 'lib/dev_system/sub/command/input_commands/highline_input_command.rb', line 3

def self.highline
  require "highline"
  @highline ||= HighLine.new
end

.pick_one(title, options = ["Yes", "No"]) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/dev_system/sub/command/input_commands/highline_input_command.rb', line 8

def self.pick_one title, options = ["Yes", "No"]
  highline.choose do |menu|
    menu.prompt = title
    options.each do |option|
      menu.choice option
    end
  end
end