Class: Luban::Deployment::Configuration::Question
- Inherits:
-
Object
- Object
- Luban::Deployment::Configuration::Question
- Defined in:
- lib/luban/deployment/configuration/question.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
Instance Method Summary collapse
- #call ⇒ Object
- #echo? ⇒ Boolean
-
#initialize(default:, prompt: nil, echo: true) ⇒ Question
constructor
A new instance of Question.
Constructor Details
#initialize(default:, prompt: nil, echo: true) ⇒ Question
Returns a new instance of Question.
7 8 9 10 11 |
# File 'lib/luban/deployment/configuration/question.rb', line 7 def initialize(default:, prompt: nil, echo: true) @default = default @echo = echo @prompt = "#{prompt.to_s}: " unless prompt.nil? end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
5 6 7 |
# File 'lib/luban/deployment/configuration/question.rb', line 5 def default @default end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
5 6 7 |
# File 'lib/luban/deployment/configuration/question.rb', line 5 def prompt @prompt end |
Instance Method Details
#call ⇒ Object
15 16 17 18 |
# File 'lib/luban/deployment/configuration/question.rb', line 15 def call ask_question get_response end |
#echo? ⇒ Boolean
13 |
# File 'lib/luban/deployment/configuration/question.rb', line 13 def echo?; @echo; end |