Class: EventEngine::DomainPackBuild
- Inherits:
-
Object
- Object
- EventEngine::DomainPackBuild
- Defined in:
- lib/event_engine/domain_pack_build.rb
Constant Summary collapse
- PORT_EMIT =
"EventEngine::Definition.publisher.publish"- SCHEMA_FILENAME =
"schema.json"- HEADER =
<<~RUBY.freeze # This file is authoritative in production. # It is generated from this pack's EventDefinitions. # Do not edit manually. RUBY
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(definitions, helper_path:, root_module:, header:, subject_registry:) ⇒ DomainPackBuild
constructor
A new instance of DomainPackBuild.
- #run ⇒ Object
- #schema_path ⇒ Object
Constructor Details
#initialize(definitions, helper_path:, root_module:, header:, subject_registry:) ⇒ DomainPackBuild
Returns a new instance of DomainPackBuild.
32 33 34 35 36 37 38 |
# File 'lib/event_engine/domain_pack_build.rb', line 32 def initialize(definitions, helper_path:, root_module:, header:, subject_registry:) @definitions = definitions @helper_path = helper_path @root_module = root_module @header = header @subject_registry = subject_registry end |
Class Method Details
.run(definitions, helper_path:, root_module:, header: HEADER, subject_registry: SubjectRegistry.new) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/event_engine/domain_pack_build.rb', line 21 def self.run(definitions, helper_path:, root_module:, header: HEADER, subject_registry: SubjectRegistry.new) new( definitions, helper_path: helper_path, root_module: root_module, header: header, subject_registry: subject_registry ).run end |
Instance Method Details
#run ⇒ Object
40 41 42 43 44 45 |
# File 'lib/event_engine/domain_pack_build.rb', line 40 def run event_schema = compile write_helper(event_schema) write_schema_json(event_schema) self end |
#schema_path ⇒ Object
47 48 49 |
# File 'lib/event_engine/domain_pack_build.rb', line 47 def schema_path File.join(File.dirname(@helper_path), SCHEMA_FILENAME) end |