Module: GBud::UserPrompt
- Defined in:
- lib/gbud/user_prompt.rb
Class Method Summary collapse
Class Method Details
.confirm_input ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/gbud/user_prompt.rb', line 35 def self.confirm_input puts "You have entered: #{@value}" print 'Is this correct? (Y/N) => ' confirm = gets.chomp.to_s.upcase return false unless confirm == 'Y' true end |
.get_value(prompt) ⇒ Object
22 23 24 25 |
# File 'lib/gbud/user_prompt.rb', line 22 def self.get_value prompt prompt_user prompt @value end |
.prompt_user(prompt) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/gbud/user_prompt.rb', line 27 def self.prompt_user prompt loop do print prompt @value = gets.chomp.to_s break if confirm_input end end |