Class: DTRToRust::Generator
- Inherits:
-
Object
- Object
- DTRToRust::Generator
- Defined in:
- lib/generator.rb
Overview
Generates Rust code from a DTR contract
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(file_path) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(file_path) ⇒ Generator
Returns a new instance of Generator.
8 9 10 11 |
# File 'lib/generator.rb', line 8 def initialize(file_path) @file_path = file_path @dtr_contract = ::DTRCore::Parser.parse(file_path) end |
Instance Method Details
#generate ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generator.rb', line 13 def generate @content = '' generate_contract_header generate_contract_name generate_state generate_functions @content end |