Class: Kommando::Stdin

Inherits:
Object
  • Object
show all
Defined in:
lib/kommando/stdin.rb

Instance Method Summary collapse

Constructor Details

#initializeStdin

Returns a new instance of Stdin.



2
3
4
# File 'lib/kommando/stdin.rb', line 2

def initialize
  @buffer = []
end

Instance Method Details

#<<(string) ⇒ Object



10
11
12
# File 'lib/kommando/stdin.rb', line 10

def <<(string)
   @buffer << string
end

#getcObject



6
7
8
# File 'lib/kommando/stdin.rb', line 6

def getc
   @buffer.shift
end

#write(string) ⇒ Object



14
15
16
# File 'lib/kommando/stdin.rb', line 14

def write(string)
  self << string
end

#writeln(string) ⇒ Object



18
19
20
# File 'lib/kommando/stdin.rb', line 18

def writeln(string)
  self << string << "\r"
end