Class: Kommando::Stdin
- Inherits:
-
Object
- Object
- Kommando::Stdin
- Defined in:
- lib/kommando/stdin.rb
Instance Method Summary collapse
- #<<(string) ⇒ Object
- #getc ⇒ Object
-
#initialize ⇒ Stdin
constructor
A new instance of Stdin.
- #write(string) ⇒ Object
- #writeln(string) ⇒ Object
Constructor Details
#initialize ⇒ Stdin
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 |
#getc ⇒ Object
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 |