Class: WIP::Runner::Spec::Helpers::UIHelpers::Simulator
- Inherits:
-
Object
- Object
- WIP::Runner::Spec::Helpers::UIHelpers::Simulator
- Defined in:
- lib/wip/runner/spec/helpers/ui_helpers.rb
Overview
adapted from gist.github.com/194554
Instance Method Summary collapse
- #eof? ⇒ Boolean
- #gets ⇒ Object
-
#initialize(values, all = false) ⇒ Simulator
constructor
A new instance of Simulator.
Constructor Details
#initialize(values, all = false) ⇒ Simulator
Returns a new instance of Simulator.
78 79 80 81 |
# File 'lib/wip/runner/spec/helpers/ui_helpers.rb', line 78 def initialize(values, all = false) @values = values.map { |s| s.nil? ? '' : s } @all = all end |
Instance Method Details
#eof? ⇒ Boolean
87 88 89 |
# File 'lib/wip/runner/spec/helpers/ui_helpers.rb', line 87 def eof? false end |
#gets ⇒ Object
83 84 85 |
# File 'lib/wip/runner/spec/helpers/ui_helpers.rb', line 83 def gets @all ? @values.first : @values.shift end |