Class: BaseShell::SimpleConsole

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

Instance Method Summary collapse

Constructor Details

#initialize(input = $stdin) ⇒ SimpleConsole

Returns a new instance of SimpleConsole.



20
21
22
# File 'lib/rhcp_shell/base_shell.rb', line 20

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

Instance Method Details

#closeObject



34
35
# File 'lib/rhcp_shell/base_shell.rb', line 34

def close
end

#readlineObject



24
25
26
27
28
29
30
31
32
# File 'lib/rhcp_shell/base_shell.rb', line 24

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