Class: HTTY::CLI::InputDevice::Pipe
- Inherits:
-
Object
- Object
- HTTY::CLI::InputDevice::Pipe
- Defined in:
- lib/htty/cli/input_device.rb
Instance Method Summary collapse
- #commands ⇒ Object
-
#initialize(display) ⇒ Pipe
constructor
A new instance of Pipe.
Constructor Details
#initialize(display) ⇒ Pipe
Returns a new instance of Pipe.
14 15 16 |
# File 'lib/htty/cli/input_device.rb', line 14 def initialize(display) @display = display end |
Instance Method Details
#commands ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/htty/cli/input_device.rb', line 18 def commands STDIN.each_line do |command_line| command_line.chomp! command_line.strip! next if command_line.empty? @display.line(command_line) yield command_line end end |