Class: ProfileRelease

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

Overview

A profile release consists of a number of releases each with one or more profiles. For example, the RVA20 profile release has profiles RVA20U64 and RVA20S64. Note there is no Portfolio* base class for a ProfileRelease to inherit from since there is no equivalent to a ProfileRelease in a Certificate so no potential for a shared base class.

Instance Method Summary collapse

Constructor Details

#initialize(data, arch_def) ⇒ ProfileRelease

Returns a new instance of ProfileRelease.

Parameters:

  • data (Hash<String, Object>)

    The data from YAML

  • arch_def (ArchDef)

    Architecture spec



73
74
75
76
# File 'lib/arch_obj_models/profile.rb', line 73

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

Instance Method Details

#contributorsArray<Person>

Returns Contributors to the profile spec.

Returns:

  • (Array<Person>)

    Contributors to the profile spec



91
92
93
# File 'lib/arch_obj_models/profile.rb', line 91

def contributors
  @data["contributors"].map { |data| Person.new(data) }
end

#introductionObject



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

def introduction = @data["introduction"]

#marketing_nameObject



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

def marketing_name = @data["marketing_name"]

#profile_classProfileClass

Returns Profile Class that this ProfileRelease belongs to.

Returns:

  • (ProfileClass)

    Profile Class that this ProfileRelease belongs to



96
97
98
99
100
101
# File 'lib/arch_obj_models/profile.rb', line 96

def profile_class
  profile_class = @arch_def.profile_class(@data["class"])
  raise "No profile class named '#{@data["class"]}'" if profile_class.nil?

  profile_class
end

#profilesArray<Profile>

Returns All profiles in this profile release.

Returns:

  • (Array<Profile>)

    All profiles in this profile release



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/arch_obj_models/profile.rb', line 104

def profiles
  return @profiles unless @profiles.nil?

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

#ratification_dateDate?

Returns:

  • (Date)

    Ratification date

  • (nil)

    if the profile is not ratified



84
85
86
87
88
# File 'lib/arch_obj_models/profile.rb', line 84

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

  Date.parse(@data["ratification_date"])
end

#referenced_extensionsArray<Extension>

Returns List of all extensions referenced by the release.

Returns:

  • (Array<Extension>)

    List of all extensions referenced by the release



117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/arch_obj_models/profile.rb', line 117

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

#stateObject



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

def state = @data["state"]