Class: Inventarium::CLI::TemplateGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/inventarium/cli/template_generator.rb

Instance Method Summary collapse

Instance Method Details

#call(dir:, payload:) ⇒ Object



6
7
8
9
10
11
# File 'lib/inventarium/cli/template_generator.rb', line 6

def call(dir:, payload:)
  template = File.read(template_file_path)
  result = ERB.new(template).result(binding)

  File.open(dir, 'w') { |f| f.write(result) }
end