Class: Capsium::Package::StorageData
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Capsium::Package::StorageData
- Defined in:
- lib/capsium/package/storage_config.rb,
sig/capsium/package/storage_config.rbs
Overview
The "storage" object holding the dataSets map and the layers stack.
Instance Attribute Summary collapse
-
#data_sets ⇒ Hash[String, DatasetConfig]
Returns the value of attribute data_sets.
-
#layers ⇒ Array[LayerConfig]
Returns the value of attribute layers.
Instance Method Summary collapse
- #data_sets_from_json(model, value) ⇒ void
- #data_sets_to_json(model, doc) ⇒ void
- #initialize ⇒ Object constructor
- #to_hash ⇒ Hash[String, untyped]
- #to_json ⇒ String
Constructor Details
#initialize ⇒ Object
55 |
# File 'sig/capsium/package/storage_config.rbs', line 55
def initialize: (?data_sets: Hash[String, DatasetConfig] data_sets,
|
Instance Attribute Details
#data_sets ⇒ Hash[String, DatasetConfig]
Returns the value of attribute data_sets.
52 53 54 |
# File 'sig/capsium/package/storage_config.rbs', line 52 def data_sets @data_sets end |
#layers ⇒ Array[LayerConfig]
Returns the value of attribute layers.
53 54 55 |
# File 'sig/capsium/package/storage_config.rbs', line 53 def layers @layers end |
Instance Method Details
#data_sets_from_json(model, value) ⇒ void
This method returns an undefined value.
82 83 84 85 86 |
# File 'lib/capsium/package/storage_config.rb', line 82 def data_sets_from_json(model, value) model.data_sets = (value || {}).to_h do |name, attributes| [name, DatasetConfig.from_json(JSON.generate(attributes))] end end |
#data_sets_to_json(model, doc) ⇒ void
This method returns an undefined value.
88 89 90 91 92 |
# File 'lib/capsium/package/storage_config.rb', line 88 def data_sets_to_json(model, doc) doc["dataSets"] = model.data_sets.sort.to_h do |name, dataset| [name, JSON.parse(dataset.to_json)] end end |
#to_hash ⇒ Hash[String, untyped]
63 |
# File 'sig/capsium/package/storage_config.rbs', line 63
def to_hash: () -> Hash[String, untyped]
|
#to_json ⇒ String
62 |
# File 'sig/capsium/package/storage_config.rbs', line 62
def to_json: (*untyped args) -> String
|