Class: Udb::Prm
- Inherits:
-
TopLevelDatabaseObject
- Object
- DatabaseObject
- TopLevelDatabaseObject
- Udb::Prm
- Defined in:
- lib/udb/obj/prm.rb
Overview
Represents a Programmer’s Reference Manual specification
Instance Attribute Summary collapse
-
#resolver ⇒ Object
Store the resolver for processor config loading.
Instance Method Summary collapse
-
#chapters ⇒ Array<Hash>
Array of chapter definitions in their natural order.
-
#description ⇒ String
Brief description of this PRM.
-
#processor_config ⇒ ConfiguredArchitecture
The processor configuration this PRM documents.
Constructor Details
This class inherits a constructor from Udb::TopLevelDatabaseObject
Instance Attribute Details
#resolver ⇒ Object
Store the resolver for processor config loading
15 16 17 |
# File 'lib/udb/obj/prm.rb', line 15 def resolver @resolver end |
Instance Method Details
#chapters ⇒ Array<Hash>
Returns Array of chapter definitions in their natural order.
46 47 48 |
# File 'lib/udb/obj/prm.rb', line 46 def chapters @data["chapters"] || [] end |
#description ⇒ String
Returns Brief description of this PRM.
19 20 21 |
# File 'lib/udb/obj/prm.rb', line 19 def description @data["description"] end |
#processor_config ⇒ ConfiguredArchitecture
Returns The processor configuration this PRM documents.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/udb/obj/prm.rb', line 25 def processor_config return @processor_config unless @processor_config.nil? config_ref = @data["processor_config"]["$ref"] # Remove the trailing # if present config_path = config_ref.sub(/#\z/, '') # Resolve relative path from PRM file location to config file prm_dir = File.dirname(@data["$source"]) config_full_path = File.(config_path, prm_dir) # Extract config name from the filename config_name = File.basename(config_full_path, '.yaml') @processor_config = @resolver.cfg_arch_for(config_name) @processor_config end |