Class: CertModel

Inherits:
PortfolioInstance show all
Defined in:
lib/arch_obj_models/certificate.rb

Overview

Holds information about a certificate model YAML file. The inherited “data” member is the database of extensions, instructions, CSRs, etc.

Defined Under Namespace

Classes: Requirement, RequirementGroup

Instance Method Summary collapse

Constructor Details

#initialize(data, arch_def) ⇒ CertModel

Returns a new instance of CertModel.

Parameters:

  • data (Hash<String, Object>)

    The data from YAML

  • arch_def (ArchDef)

    Architecture spec



31
32
33
# File 'lib/arch_obj_models/certificate.rb', line 31

def initialize(data, arch_def)
  super(data, arch_def)
end

Instance Method Details

#cert_classCertClass

Returns The certification class that this model belongs to.

Returns:

  • (CertClass)

    The certification class that this model belongs to.



50
51
52
53
54
55
# File 'lib/arch_obj_models/certificate.rb', line 50

def cert_class
  cert_class = @arch_def.ref(@data["class"]['$ref'])
  raise "No certificate class named '#{@data["class"]}'" if cert_class.nil?

  cert_class
end

#debug_manual_revisionObject



37
# File 'lib/arch_obj_models/certificate.rb', line 37

def debug_manual_revision = @data["debug_manual_revision"]

#priv_isa_manual_revisionObject



36
# File 'lib/arch_obj_models/certificate.rb', line 36

def priv_isa_manual_revision = @data["priv_isa_manual_revision"]

#requirement_groupsObject



130
131
132
133
134
135
136
137
138
# File 'lib/arch_obj_models/certificate.rb', line 130

def requirement_groups
  return @requirement_groups unless @requirement_groups.nil?

  @requirement_groups = []
  @data["requirement_groups"]&.each do |req_group|
    @requirement_groups << RequirementGroup.new(req_group, @arch_def)
  end
  @requirement_groups
end

#tsc_profileObject



39
40
41
42
43
44
45
46
47
# File 'lib/arch_obj_models/certificate.rb', line 39

def tsc_profile
  return nil if @data["tsc_profile"].nil?

  profile = arch_def.profile(@data["tsc_profile"])

  raise "No profile '#{@data["tsc_profile"]}'" if profile.nil?

  profile
end

#unpriv_isa_manual_revisionObject



35
# File 'lib/arch_obj_models/certificate.rb', line 35

def unpriv_isa_manual_revision = @data["unpriv_isa_manual_revision"]