Class: ManualVolume
- Inherits:
-
Object
- Object
- ManualVolume
- Defined in:
- lib/arch_obj_models/manual.rb
Instance Attribute Summary collapse
-
#version ⇒ ManualVersion
readonly
The version this volume belongs to.
Instance Method Summary collapse
-
#arch_def ⇒ ArchDef
The architecture definition.
- #chapter(name) ⇒ Object
- #chapters ⇒ Object
-
#extensions ⇒ Array<ExtensionVersion>
Array of extension versions in this volume.
-
#initialize(data, version) ⇒ ManualVolume
constructor
A new instance of ManualVolume.
- #title ⇒ Object
Constructor Details
#initialize(data, version) ⇒ ManualVolume
Returns a new instance of ManualVolume.
64 65 66 67 |
# File 'lib/arch_obj_models/manual.rb', line 64 def initialize(data, version) @data = data @version = version end |
Instance Attribute Details
#version ⇒ ManualVersion (readonly)
Returns The version this volume belongs to.
59 60 61 |
# File 'lib/arch_obj_models/manual.rb', line 59 def version @version end |
Instance Method Details
#arch_def ⇒ ArchDef
Returns The architecture definition.
62 |
# File 'lib/arch_obj_models/manual.rb', line 62 def arch_def = version.arch_def |
#chapter(name) ⇒ Object
82 |
# File 'lib/arch_obj_models/manual.rb', line 82 def chapter(name) = chapters.find { |c| c.name == name } |
#chapters ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/arch_obj_models/manual.rb', line 69 def chapters return @chapters unless @chapters.nil? @chapters = [] return @chapters if @data["chapters"].nil? @data["chapters"].each do |chapter_path| @chapters << ManualChapter.new(self, chapter_path) end @chapters end |
#extensions ⇒ Array<ExtensionVersion>
Returns Array of extension versions in this volume.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/arch_obj_models/manual.rb', line 87 def extensions return @extensions unless @extensions.nil? @extensions = [] return @extensions if @data["extensions"].nil? @data["extensions"].each do |ext| ext_obj = arch_def.extension(ext[0]) if ext_obj.nil? warn "Extension '#{ext[0]}' is not in the database" next end unless ext_obj.versions.any? { |v| v.version == ext[1] } warn "Extension '#{ext[0]}', version '#{ext[1]}' is not defined in the database" next end @extensions << ExtensionVersion.new(ext[0], ext[1], arch_def) end @extensions end |
#title ⇒ Object
84 |
# File 'lib/arch_obj_models/manual.rb', line 84 def title = @data["title"] |