class Basic101::Transcript

Public Class Methods

make(source_path) click to toggle source
# File lib/basic101/transcript.rb, line 7
def self.make(source_path)
  base_path = source_path.chomp('.bas')
  input_file = File.open(base_path + '.input', 'w')
  output_file = File.open(base_path + '.output', 'w')
  new(input_file, output_file)
end
new(input_file, output_file) click to toggle source
# File lib/basic101/transcript.rb, line 14
def initialize(input_file, output_file)
  @input_file = input_file
  @output_file = output_file
end

Public Instance Methods

echo?() click to toggle source
# File lib/basic101/transcript.rb, line 33
def echo?
  true
end
save_input(s) click to toggle source
# File lib/basic101/transcript.rb, line 19
def save_input(s)
  @input_file.print s
end
save_output(s) click to toggle source
# File lib/basic101/transcript.rb, line 23
def save_output(s)
  @output_file.print s
end
save_output_lines(*lines) click to toggle source
# File lib/basic101/transcript.rb, line 27
def save_output_lines(*lines)
  lines.flatten.each do |line|
    save_output "#{line}\n"
  end
end