Class: IRB::InputMethod

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

Constant Summary collapse

BASIC_WORD_BREAK_CHARACTERS =
" \t\n`><=;|&{("

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#promptObject

The irb prompt associated with this input method



17
18
19
# File 'lib/irb/input-method.rb', line 17

def prompt
  @prompt
end

Instance Method Details

#getsObject

Reads the next line from this input method.

See IO#gets for more information.



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

def gets
  fail NotImplementedError, "gets"
end

#inspectObject

For debug message



48
49
50
# File 'lib/irb/input-method.rb', line 48

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.

Returns:

  • (Boolean)


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

def readable_after_eof?
  false
end

#support_history_saving?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/irb/input-method.rb', line 43

def support_history_saving?
  false
end

#winsizeObject



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

def winsize
  if instance_variable_defined?(:@stdout) && @stdout.tty?
    @stdout.winsize
  else
    [24, 80]
  end
end