Class: EventEngine::EventSchemaDumper

Inherits:
Object
  • Object
show all
Defined in:
lib/event_engine/event_schema_dumper.rb

Class Method Summary collapse

Class Method Details

.dump!(definitions:, path:) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/event_engine/event_schema_dumper.rb', line 3

def self.dump!(definitions:, path:)
  compiled_schema = DslCompiler.compile(definitions)
  compiled_schema.finalize!

  loaded_schema = EventSchemaLoader.load(path)
  merged_schema = EventSchemaMerger.merge(compiled_schema, loaded_schema)

  EventSchemaWriter.write(path, merged_schema)
end