Class: Faccts::RustMainFileWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/faccts/04_exporting_results/rust_main_file_writer.rb

Defined Under Namespace

Classes: FileAlreadyExistsError

Constant Summary collapse

TARGET_FILE_PATH =
"./src/main.rs"

Instance Method Summary collapse

Instance Method Details

#write_file!(code_to_write) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/faccts/04_exporting_results/rust_main_file_writer.rb', line 7

def write_file!(code_to_write)
  raise FileAlreadyExistsError if file_already_exists?

  @file_contents = code_to_write

  write_file
end