class Lox::Console

Attributes

terminal[R]

Public Class Methods

new(terminal) click to toggle source
# File lib/lox/console.rb, line 7
def initialize(terminal)
  @terminal = terminal
end

Public Instance Methods

each_line() { |"#{line}\n"| ... } click to toggle source
# File lib/lox/console.rb, line 11
def each_line
  return enum_for(:each_line) unless block_given?

  while (line = readline)
    yield("#{line}\n")
  end
end

Private Instance Methods

readline() click to toggle source
# File lib/lox/console.rb, line 21
def readline
  terminal.readline('$ ', true)
end