Class: Suma::SchemaExporter
- Inherits:
-
Object
- Object
- Suma::SchemaExporter
- Defined in:
- lib/suma/schema_exporter.rb
Overview
Exports EXPRESS schemas to a directory, with optional ZIP packaging.
Pure sink: the exporter accepts already-loaded Suma::ExpressSchema
instances and writes their content to disk. Construction of those
instances (with the right output_path and is_standalone_file
flags) is the caller's responsibility — the exporter does not
reach across the seam to inspect manifest entries or classify
schema types itself.
This is a deep module: a small interface (one export method, one
option hash) backed by save_exp + zip packaging. The CLI and
SchemaCollection adapters construct ExpressSchema instances; the
exporter never inspects their shape.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#schemas ⇒ Object
readonly
Returns the value of attribute schemas.
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(schemas:, output_path:, options: {}) ⇒ SchemaExporter
constructor
A new instance of SchemaExporter.
Constructor Details
#initialize(schemas:, output_path:, options: {}) ⇒ SchemaExporter
Returns a new instance of SchemaExporter.
22 23 24 25 26 |
# File 'lib/suma/schema_exporter.rb', line 22 def initialize(schemas:, output_path:, options: {}) @schemas = schemas @output_path = Pathname.new(output_path). @options = .merge() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
20 21 22 |
# File 'lib/suma/schema_exporter.rb', line 20 def @options end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
20 21 22 |
# File 'lib/suma/schema_exporter.rb', line 20 def output_path @output_path end |
#schemas ⇒ Object (readonly)
Returns the value of attribute schemas.
20 21 22 |
# File 'lib/suma/schema_exporter.rb', line 20 def schemas @schemas end |