Class: Askable::Question

Inherits:
Object show all
Includes:
Askable
Defined in:
lib/mixins/askable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Askable

included

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

#answerObject (readonly)

Returns the value of attribute answer.



107
108
109
# File 'lib/mixins/askable.rb', line 107

def answer
  @answer
end