Class: ProfileClass

Inherits:
PortfolioClass show all
Defined in:
lib/arch_obj_models/profile.rb

Overview

A profile class consists of a number of releases each with set of profiles. For example, the RVA profile class has releases such as RVA20, RVA22, RVA23 that each include an unprivileged profile (e.g., RVA20U64) and one more privileged profiles (e.g., RVA20S64).

Instance Method Summary collapse

Constructor Details

#initialize(data, arch_def) ⇒ ProfileClass

Returns a new instance of ProfileClass.

Parameters:

  • data (Hash<String, Object>)

    The data from YAML

  • arch_def (ArchDef)

    Architecture spec



12
13
14
# File 'lib/arch_obj_models/profile.rb', line 12

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

Instance Method Details

#companyCompany

Returns Company that created the profile.

Returns:

  • (Company)

    Company that created the profile



20
# File 'lib/arch_obj_models/profile.rb', line 20

def company = Company.new(@data["company"])

#doc_licenseLicense

Returns Documentation license.

Returns:

  • (License)

    Documentation license



23
24
25
# File 'lib/arch_obj_models/profile.rb', line 23

def doc_license
  License.new(@data["doc_license"])
end

#marketing_nameString

Returns Name of the class.

Returns:

  • (String)

    Name of the class



17
# File 'lib/arch_obj_models/profile.rb', line 17

def marketing_name = @data["marketing_name"]

#profile_releasesArray<ProfileRelease>

Returns Defined profile releases in this profile class.

Returns:

  • (Array<ProfileRelease>)

    Defined profile releases in this profile class



28
29
30
31
32
33
34
# File 'lib/arch_obj_models/profile.rb', line 28

def profile_releases
  return @profile_releases unless @profile_releases.nil?

  @profile_releases = @arch_def.profile_releases.select { |pr| pr.profile_class.name == name }

  @profile_releases
end

#profilesArray<Profile>

Returns All profiles in this profile class (for all releases).

Returns:

  • (Array<Profile>)

    All profiles in this profile class (for all releases).



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/arch_obj_models/profile.rb', line 37

def profiles
  return @profiles unless @profiles.nil?

  @profiles = []
  @arch_def.profiles.each do |profile|
    if profile.profile_class.name == name
      @profiles << profile
    end
  end

  @profiles
end

#referenced_extensionsArray<Extension>

Returns List of all extensions referenced by the class.

Returns:

  • (Array<Extension>)

    List of all extensions referenced by the class



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/arch_obj_models/profile.rb', line 51

def referenced_extensions
  return @referenced_extensions unless @referenced_extensions.nil?

  @referenced_extensions = []
  profiles.each do |profile|
    @referenced_extensions += profile.in_scope_extensions
  end

  @referenced_extensions.uniq!(&:name)

  @referenced_extensions
end