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?
118 119 120 121 122 |
# File 'lib/stairs/step.rb', line 118 def initialize(question, choices=%w[Y N], &block) @question = question @choices = choices @block = block end |
Instance Method Details
#run ⇒ Object
124 125 126 127 |
# File 'lib/stairs/step.rb', line 124 def run block.call processed_response if block processed_response end |