Class: ProfileClass
- Inherits:
-
PortfolioClass
- Object
- ArchDefObject
- PortfolioClass
- ProfileClass
- 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
-
#company ⇒ Company
Company that created the profile.
-
#doc_license ⇒ License
Documentation license.
-
#initialize(data, arch_def) ⇒ ProfileClass
constructor
A new instance of ProfileClass.
-
#marketing_name ⇒ String
Name of the class.
-
#profile_releases ⇒ Array<ProfileRelease>
Defined profile releases in this profile class.
-
#profiles ⇒ Array<Profile>
All profiles in this profile class (for all releases).
-
#referenced_extensions ⇒ Array<Extension>
List of all extensions referenced by the class.
Constructor Details
#initialize(data, arch_def) ⇒ ProfileClass
Returns a new instance of ProfileClass.
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
#company ⇒ Company
Returns Company that created the profile.
20 |
# File 'lib/arch_obj_models/profile.rb', line 20 def company = Company.new(@data["company"]) |
#doc_license ⇒ License
Returns Documentation license.
23 24 25 |
# File 'lib/arch_obj_models/profile.rb', line 23 def doc_license License.new(@data["doc_license"]) end |
#marketing_name ⇒ String
Returns Name of the class.
17 |
# File 'lib/arch_obj_models/profile.rb', line 17 def marketing_name = @data["marketing_name"] |
#profile_releases ⇒ Array<ProfileRelease>
Returns 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 |
#profiles ⇒ Array<Profile>
Returns 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_extensions ⇒ Array<Extension>
Returns 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 |