Class: Ea::Spa::Skeleton

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#entriesObject

Returns the value of attribute entries

Returns:

  • (Object)

    the current value of entries



9
10
11
# File 'lib/ea/spa/skeleton.rb', line 9

def entries
  @entries
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



9
10
11
# File 'lib/ea/spa/skeleton.rb', line 9

def 
  @metadata
end

#package_treeObject

Returns the value of attribute package_tree

Returns:

  • (Object)

    the current value of package_tree



9
10
11
# File 'lib/ea/spa/skeleton.rb', line 9

def package_tree
  @package_tree
end

#view_extrasObject

Returns the value of attribute view_extras

Returns:

  • (Object)

    the current value of 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