Class: IRB::InputMethod
Direct Known Subclasses
FileInputMethod, ReidlineInputMethod, StdioInputMethod, XMP::StringInputMethod
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
The file name of this input method, usually given during initialization.
-
#prompt ⇒ Object
The irb prompt associated with this input method.
Instance Method Summary collapse
-
#gets ⇒ Object
Reads the next line from this input method.
-
#initialize(file = STDIN_FILE_NAME) ⇒ InputMethod
constructor
Creates a new input method object.
-
#inspect ⇒ Object
For debug message.
-
#readable_after_eof? ⇒ Boolean
Whether this input method is still readable when there is no more data to read.
- #winsize ⇒ Object
Constructor Details
#initialize(file = STDIN_FILE_NAME) ⇒ InputMethod
Creates a new input method object
23 24 25 |
# File 'lib/irb/input-method.rb', line 23 def initialize(file = STDIN_FILE_NAME) @file_name = file end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
The file name of this input method, usually given during initialization.
27 28 29 |
# File 'lib/irb/input-method.rb', line 27 def file_name @file_name end |
#prompt ⇒ Object
The irb prompt associated with this input method
30 31 32 |
# File 'lib/irb/input-method.rb', line 30 def prompt @prompt end |
Instance Method Details
#gets ⇒ Object
Reads the next line from this input method.
See IO#gets for more information.
35 36 37 |
# File 'lib/irb/input-method.rb', line 35 def gets fail NotImplementedError, "gets" end |
#inspect ⇒ Object
For debug message
57 58 59 |
# File 'lib/irb/input-method.rb', line 57 def inspect 'Abstract InputMethod' end |
#readable_after_eof? ⇒ Boolean
Whether this input method is still readable when there is no more data to read.
See IO#eof for more information.
52 53 54 |
# File 'lib/irb/input-method.rb', line 52 def readable_after_eof? false end |
#winsize ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/irb/input-method.rb', line 40 def winsize if instance_variable_defined?(:@stdout) @stdout.winsize else [24, 80] end end |