Class: RosettAi::Content::PackManifest
- Inherits:
-
Object
- Object
- RosettAi::Content::PackManifest
- Defined in:
- lib/rosett_ai/content/pack_manifest.rb
Overview
Loads, validates, and provides access to content pack manifest data.
Manifest files are YAML (parsed with safe_load only) and validated against the content_pack_manifest_schema.json schema.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #author ⇒ Object
- #behaviour_files ⇒ Object
- #contents ⇒ Object
- #description ⇒ Object
- #design_files ⇒ Object
-
#initialize(data) ⇒ PackManifest
constructor
A new instance of PackManifest.
- #name ⇒ Object
- #tier_required ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(data) ⇒ PackManifest
Returns a new instance of PackManifest.
17 18 19 20 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 17 def initialize(data) @data = data validate! end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
15 16 17 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 15 def data @data end |
Class Method Details
.from_file(path) ⇒ Object
22 23 24 25 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 22 def self.from_file(path) data = RosettAi::YamlLoader.load_file(path) new(data) end |
Instance Method Details
#author ⇒ Object
31 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 31 def = data['author'] |
#behaviour_files ⇒ Object
33 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 33 def behaviour_files = contents['behaviours'] || [] |
#contents ⇒ Object
32 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 32 def contents = data['contents'] || {} |
#description ⇒ Object
30 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 30 def description = data['description'] |
#design_files ⇒ Object
34 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 34 def design_files = contents['designs'] || [] |
#name ⇒ Object
27 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 27 def name = data['name'] |
#tier_required ⇒ Object
29 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 29 def tier_required = data['tier_required'] |
#version ⇒ Object
28 |
# File 'lib/rosett_ai/content/pack_manifest.rb', line 28 def version = data['version'] |