Class: Faccts::RustSpecifiedFileWriter
- Inherits:
-
Object
- Object
- Faccts::RustSpecifiedFileWriter
- Defined in:
- lib/faccts/04_exporting_results/rust_specified_file_writer.rb
Defined Under Namespace
Classes: InvalidWriteDestinationError, UnknownWriteDestinationError
Constant Summary collapse
- TARGET_FILE_NAME =
"acceptance_tests.rs"
Instance Attribute Summary collapse
-
#target_file_path ⇒ Object
readonly
Returns the value of attribute target_file_path.
Instance Method Summary collapse
-
#initialize(target_file_path) ⇒ RustSpecifiedFileWriter
constructor
A new instance of RustSpecifiedFileWriter.
- #write_file!(file_contents) ⇒ Object
Constructor Details
#initialize(target_file_path) ⇒ RustSpecifiedFileWriter
Returns a new instance of RustSpecifiedFileWriter.
9 10 11 |
# File 'lib/faccts/04_exporting_results/rust_specified_file_writer.rb', line 9 def initialize(target_file_path) @target_file_path = target_file_path end |
Instance Attribute Details
#target_file_path ⇒ Object (readonly)
Returns the value of attribute target_file_path.
7 8 9 |
# File 'lib/faccts/04_exporting_results/rust_specified_file_writer.rb', line 7 def target_file_path @target_file_path end |
Instance Method Details
#write_file!(file_contents) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/faccts/04_exporting_results/rust_specified_file_writer.rb', line 13 def write_file!(file_contents) raise UnknownWriteDestinationError if target_file_path_is_not_specified? raise InvalidWriteDestinationError, target_file_path unless target_file_path_is_valid? @file_contents = file_contents write_file end |