Class: Ea::Export::Json::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/ea/export/json/generator.rb

Overview

Generates a curated JSON snapshot of a parsed QEA model.

Each collection is projected through a per-model schema so the output is stable and free of Lutaml::Model internals. Collections without a projection are emitted as { "name" => ..., "id" => ..., "record_type" => ... } triples — enough metadata for downstream tools without leaking implementation details.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Generator

Returns a new instance of Generator.



23
24
25
# File 'lib/ea/export/json/generator.rb', line 23

def initialize(model)
  @model = model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



21
22
23
# File 'lib/ea/export/json/generator.rb', line 21

def model
  @model
end

Class Method Details

.call(model, **_opts) ⇒ Object



17
18
19
# File 'lib/ea/export/json/generator.rb', line 17

def self.call(model, **_opts)
  new(model).call
end

Instance Method Details

#callObject



27
28
29
# File 'lib/ea/export/json/generator.rb', line 27

def call
  JSON.pretty_generate(document_hash)
end