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
- #encoding ⇒ Object
- #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.
75 76 77 78 |
# File 'lib/irb/input-method.rb', line 75 def initialize(file) super @io = IRB::MagicFile.open(file) end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name
79 80 81 |
# File 'lib/irb/input-method.rb', line 79 def file_name @file_name end |
Instance Method Details
#encoding ⇒ Object
92 93 94 |
# File 'lib/irb/input-method.rb', line 92 def encoding @io.external_encoding end |
#eof? ⇒ Boolean
81 82 83 |
# File 'lib/irb/input-method.rb', line 81 def eof? @io.eof? end |
#gets ⇒ Object
85 86 87 88 89 90 |
# File 'lib/irb/input-method.rb', line 85 def gets print @prompt l = @io.gets # print @prompt, l l end |