Class: IRB::StdioInputMethod
- Inherits:
-
InputMethod
- Object
- InputMethod
- IRB::StdioInputMethod
- Defined in:
- lib/irb/input-method.rb
Instance Attribute Summary
Attributes inherited from InputMethod
Instance Method Summary collapse
- #eof? ⇒ Boolean
- #gets ⇒ Object
-
#initialize ⇒ StdioInputMethod
constructor
A new instance of StdioInputMethod.
- #line(line_no) ⇒ Object
- #readable_atfer_eof? ⇒ Boolean
Constructor Details
#initialize ⇒ StdioInputMethod
Returns a new instance of StdioInputMethod.
41 42 43 44 45 |
# File 'lib/irb/input-method.rb', line 41 def initialize super @line_no = 0 @line = [] end |
Instance Method Details
#eof? ⇒ Boolean
52 53 54 |
# File 'lib/irb/input-method.rb', line 52 def eof? $stdin.eof? end |
#gets ⇒ Object
47 48 49 50 |
# File 'lib/irb/input-method.rb', line 47 def gets print @prompt @line[@line_no += 1] = $stdin.gets end |
#line(line_no) ⇒ Object
60 61 62 |
# File 'lib/irb/input-method.rb', line 60 def line(line_no) @line[line_no] end |
#readable_atfer_eof? ⇒ Boolean
56 57 58 |
# File 'lib/irb/input-method.rb', line 56 def readable_atfer_eof? true end |