Class: BaseShell::SimpleConsole

Inherits:
Object
  • Object
show all
Defined in:
lib/vop/shell/base_shell.rb

Instance Method Summary collapse

Constructor Details

#initialize(input = $stdin) ⇒ SimpleConsole

Returns a new instance of SimpleConsole.



22
23
24
# File 'lib/vop/shell/base_shell.rb', line 22

def initialize(input = $stdin)
  @input = input
end

Instance Method Details

#closeObject



36
37
# File 'lib/vop/shell/base_shell.rb', line 36

def close
end

#readlineObject



26
27
28
29
30
31
32
33
34
# File 'lib/vop/shell/base_shell.rb', line 26

def readline
  begin
    line = @input.readline
    line.chomp! if line
    line
  rescue EOFError
    nil
  end
end