Class: Capsium::Package::MetadataData
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Capsium::Package::MetadataData
- Defined in:
- lib/capsium/package/metadata_config.rb,
sig/capsium/package/metadata_config.rbs
Overview
Canonical metadata.json model (ARCHITECTURE.md section 2). The legacy array form of "dependencies" is normalized on read; writers emit only the object form.
Constant Summary collapse
- KEBAB_CASE_PATTERN =
/\A[a-z0-9]+(-[a-z0-9]+)*\z/- SEMVER_PATTERN =
/\A\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?\z/- UUID_PATTERN =
/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/i
Instance Attribute Summary collapse
-
#author ⇒ String?
Returns the value of attribute author.
-
#dependencies ⇒ Hash[String, String]
Returns the value of attribute dependencies.
-
#description ⇒ String?
Returns the value of attribute description.
-
#guid ⇒ String?
Returns the value of attribute guid.
-
#license ⇒ String?
Returns the value of attribute license.
-
#name ⇒ String?
Returns the value of attribute name.
-
#read_only ⇒ Boolean?
Returns the value of attribute read_only.
-
#repository ⇒ Repository?
Returns the value of attribute repository.
-
#uuid ⇒ String?
Returns the value of attribute uuid.
-
#version ⇒ String?
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#format_errors ⇒ Array[String]
Field-level format validations; empty when valid.
- #initialize ⇒ Object constructor
- #to_hash ⇒ Hash[String, untyped]
- #to_json ⇒ String
Constructor Details
#initialize ⇒ Object
33 |
# File 'sig/capsium/package/metadata_config.rbs', line 33
def initialize: (?name: String? name, ?version: String? version,
|
Instance Attribute Details
#author ⇒ String?
Returns the value of attribute author.
27 28 29 |
# File 'sig/capsium/package/metadata_config.rbs', line 27 def @author end |
#dependencies ⇒ Hash[String, String]
Returns the value of attribute dependencies.
30 31 32 |
# File 'sig/capsium/package/metadata_config.rbs', line 30 def dependencies @dependencies end |
#description ⇒ String?
Returns the value of attribute description.
24 25 26 |
# File 'sig/capsium/package/metadata_config.rbs', line 24 def description @description end |
#guid ⇒ String?
Returns the value of attribute guid.
25 26 27 |
# File 'sig/capsium/package/metadata_config.rbs', line 25 def guid @guid end |
#license ⇒ String?
Returns the value of attribute license.
28 29 30 |
# File 'sig/capsium/package/metadata_config.rbs', line 28 def license @license end |
#name ⇒ String?
Returns the value of attribute name.
22 23 24 |
# File 'sig/capsium/package/metadata_config.rbs', line 22 def name @name end |
#read_only ⇒ Boolean?
Returns the value of attribute read_only.
31 32 33 |
# File 'sig/capsium/package/metadata_config.rbs', line 31 def read_only @read_only end |
#repository ⇒ Repository?
Returns the value of attribute repository.
29 30 31 |
# File 'sig/capsium/package/metadata_config.rbs', line 29 def repository @repository end |
#uuid ⇒ String?
Returns the value of attribute uuid.
26 27 28 |
# File 'sig/capsium/package/metadata_config.rbs', line 26 def uuid @uuid end |
#version ⇒ String?
Returns the value of attribute version.
23 24 25 |
# File 'sig/capsium/package/metadata_config.rbs', line 23 def version @version end |
Class Method Details
.from_json(json) ⇒ instance
53 54 55 56 57 |
# File 'lib/capsium/package/metadata_config.rb', line 53 def self.from_json(json) doc = JSON.parse(json) doc["dependencies"] = normalize_dependencies(doc["dependencies"]) super(JSON.generate(doc)) end |
Instance Method Details
#format_errors ⇒ Array[String]
Field-level format validations; empty when valid.
69 70 71 |
# File 'lib/capsium/package/metadata_config.rb', line 69 def format_errors presence_errors + format_field_errors end |
#to_hash ⇒ Hash[String, untyped]
46 |
# File 'sig/capsium/package/metadata_config.rbs', line 46
def to_hash: () -> Hash[String, untyped]
|
#to_json ⇒ String
45 |
# File 'sig/capsium/package/metadata_config.rbs', line 45
def to_json: (*untyped args) -> String
|