Module: Stupidedi::Schema::Generation::Support
- Included in:
- DefinitionGenerator, ElementGenerator, FunctionalGroupGenerator, InterchangeGenerator, MasterLoaderGenerator, ModuleLoaderGenerator, RegistrationGenerator, SegmentGenerator, SupportModulesGenerator
- Defined in:
- lib/stupidedi/schema/generation/support.rb
Overview
Shared helpers mixed into every generator.
The host class must provide a private #release_code returning the
6-character release string (e.g. "005010") and may set @namespace,
the root Ruby module for the emitted code (defaults to "Edi").
Instance Method Summary collapse
-
#namespace ⇒ Object
Root module for generated constants, e.g.
-
#namespace_path ⇒ Object
Filesystem/require-path root derived from the namespace ("Edi" -> "edi").
Instance Method Details
#namespace ⇒ Object
Root module for generated constants, e.g. "Edi". Consumers override this to emit into their own namespace. Validated (and memoized) on first use so an invalid namespace fails before any code is emitted.
15 16 17 |
# File 'lib/stupidedi/schema/generation/support.rb', line 15 def namespace @validated_namespace ||= Generation.validate_namespace!(@namespace || "Edi") end |
#namespace_path ⇒ Object
Filesystem/require-path root derived from the namespace ("Edi" -> "edi").
20 21 22 |
# File 'lib/stupidedi/schema/generation/support.rb', line 20 def namespace_path underscore(namespace) end |