Class: IRB::InputMethod

Inherits:
Object show all
Defined in:
lib/irb/input-method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file = STDIN_FILE_NAME) ⇒ InputMethod

Creates a new input method object



19
20
21
# File 'lib/irb/input-method.rb', line 19

def initialize(file = STDIN_FILE_NAME)
  @file_name = file
end

Instance Attribute Details

#file_nameObject (readonly)

The file name of this input method, usually given during initialization.



23
24
25
# File 'lib/irb/input-method.rb', line 23

def file_name
  @file_name
end

#promptObject

The irb prompt associated with this input method



26
27
28
# File 'lib/irb/input-method.rb', line 26

def prompt
  @prompt
end

Instance Method Details

#getsObject

Reads the next line from this input method.

See IO#gets for more information.



31
32
33
# File 'lib/irb/input-method.rb', line 31

def gets
  IRB.fail NotImplementedError, "gets"
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.

Returns:

  • (Boolean)


40
41
42
# File 'lib/irb/input-method.rb', line 40

def readable_after_eof?
  false
end