Class: Askable::Question
- Includes:
- Askable
- Defined in:
- lib/mixins/askable.rb
Instance Attribute Summary collapse
-
#answer ⇒ Object
readonly
Returns the value of attribute answer.
Instance Method Summary collapse
-
#initialize(question, input = STDIN, opts = {}) ⇒ Question
constructor
A new instance of Question.
Methods included from Askable
Constructor Details
#initialize(question, input = STDIN, opts = {}) ⇒ Question
Returns a new instance of Question.
110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/mixins/askable.rb', line 110 def initialize(question, input=STDIN, opts={}) @question = question @input = input defaults = { :wrap => 60 } @opts = defaults.merge(opts) ask end |
Instance Attribute Details
#answer ⇒ Object (readonly)
Returns the value of attribute answer.
107 108 109 |
# File 'lib/mixins/askable.rb', line 107 def answer @answer end |