Module: Configliere::Prompt
- Defined in:
- lib/configliere/prompt.rb
Overview
Method to prompt for
Instance Method Summary collapse
-
#prompt_for(attr, hint = nil) ⇒ Object
Retrieve the given param, or prompt for it.
Instance Method Details
#prompt_for(attr, hint = nil) ⇒ Object
Retrieve the given param, or prompt for it
12 13 14 15 16 17 |
# File 'lib/configliere/prompt.rb', line 12 def prompt_for attr, hint=nil return self[attr] if has_key?(attr) hint ||= definition_of(attr, :description) hint = " (#{hint})" if hint self[attr] = ask("#{attr}#{hint}? ") end |