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
Returns a new instance of RustCodeTemplate.
23 24 25 |
# File 'lib/faccts/03_generating_code/rust_code_generator.rb', line 23 def initialize(fetcher_strategy) @code_template_fetcher = fetcher_strategy end |
Instance Method Details
#generate_with_values(*values) ⇒ Object
27 28 29 30 31 |
# File 'lib/faccts/03_generating_code/rust_code_generator.rb', line 27 def generate_with_values(*values) values.reduce(code_template) do |template, value| insert_value_into_placeholder(template, value) end end |