Class: Faccts::RustCodeGenerator::RustCodeTemplate
- Inherits:
-
Object
- Object
- Faccts::RustCodeGenerator::RustCodeTemplate
- Defined in:
- lib/faccts/03_generating_code/rust_code_generator.rb
Constant Summary collapse
- RUST_TEMPLATE_INSERT_SYMBOL =
"/*{}*/"
Instance Method Summary collapse
- #generate_with_values(*values) ⇒ Object
-
#initialize(fetcher_strategy) ⇒ RustCodeTemplate
constructor
A new instance of RustCodeTemplate.
Constructor Details
#initialize(fetcher_strategy) ⇒ RustCodeTemplate
15 16 17 |
# File 'lib/faccts/03_generating_code/rust_code_generator.rb', line 15 def initialize(fetcher_strategy) @code_template_fetcher = fetcher_strategy end |
Instance Method Details
#generate_with_values(*values) ⇒ Object
19 20 21 22 23 |
# File 'lib/faccts/03_generating_code/rust_code_generator.rb', line 19 def generate_with_values(*values) values.reduce(code_template) do |template, value| insert_value_into_placeholder(template, value) end end |