Class: Ea::Spa::Skeleton
- Inherits:
-
Struct
- Object
- Struct
- Ea::Spa::Skeleton
- Defined in:
- lib/ea/spa/skeleton.rb
Overview
Top-level SPA skeleton. Plain Struct (not a lutaml-model type) because it's a thin transport wrapper around typed sub-objects (PackageTree, SkeletonEntry) plus a raw metadata hash extracted from the model.
Instance Attribute Summary collapse
-
#entries ⇒ Object
Returns the value of attribute entries.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#package_tree ⇒ Object
Returns the value of attribute package_tree.
-
#view_extras ⇒ Object
Returns the value of attribute view_extras.
Instance Method Summary collapse
Instance Attribute Details
#entries ⇒ Object
Returns the value of attribute entries
9 10 11 |
# File 'lib/ea/spa/skeleton.rb', line 9 def entries @entries end |
#metadata ⇒ Object
Returns the value of attribute metadata
9 10 11 |
# File 'lib/ea/spa/skeleton.rb', line 9 def @metadata end |
#package_tree ⇒ Object
Returns the value of attribute package_tree
9 10 11 |
# File 'lib/ea/spa/skeleton.rb', line 9 def package_tree @package_tree end |
#view_extras ⇒ Object
Returns the value of attribute view_extras
9 10 11 |
# File 'lib/ea/spa/skeleton.rb', line 9 def view_extras @view_extras end |
Instance Method Details
#to_json(*args) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/ea/spa/skeleton.rb', line 11 def to_json(*args) payload = { "metadata" => , "packageTree" => package_tree, "entries" => entries } payload["viewExtras"] = view_extras unless view_extras.nil? || view_extras.empty? JSON.generate(payload, *args) end |