Class: Faccts::RustCodeGenerator::RustCodeTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/faccts/03_generating_code/rust_code_generator.rb

Constant Summary collapse

RUST_TEMPLATE_INSERT_SYMBOL =
"/*{}*/"

Instance Method Summary collapse

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