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

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

Overview

Generates a JSON snapshot of a parsed QEA model. Walks each collection and emits array entries with the row's lutaml-model hash representation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Generator

Returns a new instance of Generator.



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

def initialize(model)
  @model = model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



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

def model
  @model
end

Class Method Details

.call(model, **_opts) ⇒ Object



12
13
14
# File 'lib/ea/export/json/generator.rb', line 12

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

Instance Method Details

#callObject



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

def call
  JSON.pretty_generate(document_hash)
end