Class: IRB::FileInputMethod
- Inherits:
-
InputMethod
- Object
- InputMethod
- IRB::FileInputMethod
- Defined in:
- lib/irb/input-method.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
Attributes inherited from InputMethod
Instance Method Summary collapse
- #eof? ⇒ Boolean
- #gets ⇒ Object
-
#initialize(file) ⇒ FileInputMethod
constructor
A new instance of FileInputMethod.
Methods inherited from InputMethod
Constructor Details
#initialize(file) ⇒ FileInputMethod
Returns a new instance of FileInputMethod.
66 67 68 69 |
# File 'lib/irb/input-method.rb', line 66 def initialize(file) super @io = open(file) end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name
70 71 72 |
# File 'lib/irb/input-method.rb', line 70 def file_name @file_name end |
Instance Method Details
#eof? ⇒ Boolean
72 73 74 |
# File 'lib/irb/input-method.rb', line 72 def eof? @io.eof? end |
#gets ⇒ Object
76 77 78 79 80 81 |
# File 'lib/irb/input-method.rb', line 76 def gets print @prompt l = @io.gets # print @prompt, l l end |