Class: Capsium::Package::StorageConfig
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Capsium::Package::StorageConfig
- Defined in:
- lib/capsium/package/storage_config.rb,
sig/capsium/package/storage_config.rbs
Overview
Canonical storage.json model. The legacy array form is normalized on read; writers emit only the canonical form.
Instance Attribute Summary collapse
-
#storage ⇒ StorageData?
Returns the value of attribute storage.
Class Method Summary collapse
Instance Method Summary collapse
- #data_sets ⇒ Hash[String, DatasetConfig]
-
#initialize ⇒ StorageConfig
constructor
A new instance of StorageConfig.
-
#layers ⇒ Array[LayerConfig]
The configured storage layers, bottom -> top (empty when the package uses the single implicit content/ layer).
- #to_hash ⇒ Hash[String, untyped]
- #to_json ⇒ String
Constructor Details
#initialize ⇒ StorageConfig
Returns a new instance of StorageConfig.
71 |
# File 'sig/capsium/package/storage_config.rbs', line 71
def initialize: (?storage: StorageData? storage) -> void
|
Instance Attribute Details
#storage ⇒ StorageData?
Returns the value of attribute storage.
69 70 71 |
# File 'sig/capsium/package/storage_config.rbs', line 69 def storage @storage end |
Class Method Details
.from_json(json) ⇒ instance
105 106 107 108 109 |
# File 'lib/capsium/package/storage_config.rb', line 105 def self.from_json(json) doc = JSON.parse(json) doc["storage"] ||= { "dataSets" => legacy_data_sets(doc.delete("datasets")) } super(JSON.generate(doc)) end |
Instance Method Details
#data_sets ⇒ Hash[String, DatasetConfig]
123 124 125 |
# File 'lib/capsium/package/storage_config.rb', line 123 def data_sets storage ? storage.data_sets : {} end |
#layers ⇒ Array[LayerConfig]
The configured storage layers, bottom -> top (empty when the package uses the single implicit content/ layer).
129 130 131 |
# File 'lib/capsium/package/storage_config.rb', line 129 def layers storage ? storage.layers : [] end |
#to_hash ⇒ Hash[String, untyped]
82 |
# File 'sig/capsium/package/storage_config.rbs', line 82
def to_hash: () -> Hash[String, untyped]
|
#to_json ⇒ String
81 |
# File 'sig/capsium/package/storage_config.rbs', line 81
def to_json: (*untyped args) -> String
|