Class: Ea::Export::Json::Generator
- Inherits:
-
Object
- Object
- Ea::Export::Json::Generator
- 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
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(model) ⇒ Generator
constructor
A new instance of Generator.
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
#model ⇒ Object (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
#call ⇒ Object
22 23 24 |
# File 'lib/ea/export/json/generator.rb', line 22 def call JSON.pretty_generate(document_hash) end |