Class: Moku6::Generators::BaseGenerator
- Inherits:
-
Object
- Object
- Moku6::Generators::BaseGenerator
- Defined in:
- lib/moku6/generators/base_generator.rb
Direct Known Subclasses
BigQueryGenerator, CloudEventsGenerator, DocsGenerator, EventCatalogGenerator, ExampleGenerator, JsonSchemaGenerator, OpenApiGenerator, OutboxGenerator, RailsGenerator, RubyGenerator, TypeScriptGenerator
Constant Summary collapse
- AUTOGEN_NOTE =
: String
"AUTO-GENERATED by moku6. DO NOT EDIT."
Instance Method Summary collapse
-
#initialize(catalog, config) ⇒ BaseGenerator
constructor
: (Catalog catalog, Config config) -> void.
-
#render ⇒ Object
: () -> String.
-
#write(path) ⇒ Object
: (String path) -> String.
Constructor Details
#initialize(catalog, config) ⇒ BaseGenerator
: (Catalog catalog, Config config) -> void
15 16 17 18 |
# File 'lib/moku6/generators/base_generator.rb', line 15 def initialize(catalog, config) @catalog = catalog @config = config end |
Instance Method Details
#render ⇒ Object
: () -> String
21 |
# File 'lib/moku6/generators/base_generator.rb', line 21 def render = raise NotImplementedError |
#write(path) ⇒ Object
: (String path) -> String
24 25 26 27 28 |
# File 'lib/moku6/generators/base_generator.rb', line 24 def write(path) FileUtils.mkdir_p(File.dirname(path)) File.write(path, render) path end |