Class: Stairs::Step::Choice
- Inherits:
-
Object
- Object
- Stairs::Step::Choice
- Defined in:
- lib/stairs/step.rb
Instance Method Summary collapse
-
#initialize(question, choices = %w(Y N),, &block) ⇒ Choice
constructor
TODO: shouldn’t care about case?.
- #run ⇒ Object
Constructor Details
#initialize(question, choices = %w(Y N),, &block) ⇒ Choice
TODO: shouldn’t care about case?
123 124 125 126 127 |
# File 'lib/stairs/step.rb', line 123 def initialize(question, choices=%w(Y N), &block) @question = question @choices = choices @block = block end |
Instance Method Details
#run ⇒ Object
129 130 131 132 |
# File 'lib/stairs/step.rb', line 129 def run block.call processed_response if block processed_response end |