Class: Udb::ProfileFamily
- Inherits:
-
PortfolioClass
- Object
- DatabaseObject
- TopLevelDatabaseObject
- PortfolioClass
- Udb::ProfileFamily
- Defined in:
- lib/udb/obj/profile.rb
Overview
A profile class consists of a number of releases each with set of profiles. For example, the RVA profile family 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 Attribute Summary
Attributes inherited from DatabaseObject
#arch, #data, #data_path, #long_name, #name
Instance Method Summary collapse
-
#company ⇒ Company
Company that created the profile.
-
#doc_license ⇒ License
Documentation license.
-
#in_scope_extensions ⇒ Array<Extension>
Sorted list of all mandatory or optional extensions across the profile releases belonging to the profile family.
-
#in_scope_extensions_matching_processor_kind ⇒ Array<Extension>
Sorted list of all potential extensions with my processor kind.
-
#marketing_name ⇒ String
Name of the class.
-
#naming_scheme ⇒ String
Naming scheme for profile family.
-
#profile_releases ⇒ Array<ProfileRelease>
Defined profile releases in this profile family.
-
#profile_releases_matching_processor_kind ⇒ Array<ProfileRelease>
Defined profile releases of this processor class.
-
#profiles ⇒ Array<Profile>
All profiles in this profile family (for all releases).
-
#profiles_matching_processor_kind ⇒ Array<Profile>
All profiles in database matching my processor kind.
Methods inherited from PortfolioClass
#description, #eql?, #introduction, #portfolio_classes_matching_portfolio_kind_and_processor_kind, #processor_kind
Methods inherited from TopLevelDatabaseObject
create_json_schemer_resolver, #initialize, #key?, #keys, #validate
Methods inherited from DatabaseObject
#<=>, #__source, #cfg_arch, #cfg_arch?, #clone, #defer, #defined_by_condition, #description, #initialize, #inspect, #kind, #source_line
Constructor Details
This class inherits a constructor from Udb::TopLevelDatabaseObject
Instance Method Details
#company ⇒ Company
Returns Company that created the profile.
22 |
# File 'lib/udb/obj/profile.rb', line 22 def company = Company.new(@data["company"]) |
#doc_license ⇒ License
Returns Documentation license.
25 26 27 |
# File 'lib/udb/obj/profile.rb', line 25 def doc_license License.new(@data["doc_license"]) end |
#in_scope_extensions ⇒ Array<Extension>
Returns Sorted list of all mandatory or optional extensions across the profile releases belonging to the profile family.
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/udb/obj/profile.rb', line 68 def in_scope_extensions return @in_scope_extensions unless @in_scope_extensions.nil? @in_scope_extensions = [] profiles.each do |profile| @in_scope_extensions += profile.in_scope_extensions end @in_scope_extensions = @in_scope_extensions.uniq(&:name).sort_by(&:name) end |
#in_scope_extensions_matching_processor_kind ⇒ Array<Extension>
Returns Sorted list of all potential extensions with my processor kind.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/udb/obj/profile.rb', line 80 def in_scope_extensions_matching_processor_kind return @in_scope_extensions_matching_processor_kind unless @in_scope_extensions_matching_processor_kind.nil? @in_scope_extensions_matching_processor_kind = [] profiles_matching_processor_kind.each do |profile| @in_scope_extensions_matching_processor_kind += profile.in_scope_extensions end @in_scope_extensions_matching_processor_kind = @in_scope_extensions_matching_processor_kind.uniq(&:name).sort_by(&:name) end |
#marketing_name ⇒ String
Returns Name of the class.
19 |
# File 'lib/udb/obj/profile.rb', line 19 def marketing_name = @data["marketing_name"] |
#naming_scheme ⇒ String
Returns Naming scheme for profile family.
16 |
# File 'lib/udb/obj/profile.rb', line 16 def naming_scheme = @data["naming_scheme"] |
#profile_releases ⇒ Array<ProfileRelease>
Returns Defined profile releases in this profile family.
30 31 32 33 34 35 36 |
# File 'lib/udb/obj/profile.rb', line 30 def profile_releases return @profile_releases unless @profile_releases.nil? @profile_releases = @arch.profile_releases.select { |pr| pr.profile_family.name == name } @profile_releases end |
#profile_releases_matching_processor_kind ⇒ Array<ProfileRelease>
Returns Defined profile releases of this processor class.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/udb/obj/profile.rb', line 39 def profile_releases_matching_processor_kind return @profile_releases_matching_processor_kind unless @profile_releases_matching_processor_kind.nil? matching_classes = portfolio_classes_matching_portfolio_kind_and_processor_kind # Look for all profile releases that are from any of the matching classes. @profile_releases_matching_processor_kind = @arch.profile_releases.select { |pr| matching_classes.any? { |matching_class| matching_class.name == pr.profile_family.name } } @profile_releases_matching_processor_kind end |
#profiles ⇒ Array<Profile>
Returns All profiles in this profile family (for all releases).
53 54 55 56 57 |
# File 'lib/udb/obj/profile.rb', line 53 def profiles return @profiles unless @profiles.nil? @profiles = @arch.profiles.select { |profile| profile.profile_family.name == name } end |
#profiles_matching_processor_kind ⇒ Array<Profile>
Returns All profiles in database matching my processor kind.
60 61 62 63 64 |
# File 'lib/udb/obj/profile.rb', line 60 def profiles_matching_processor_kind return @profiles_matching_processor_kind unless @profiles_matching_processor_kind.nil? @profiles_matching_processor_kind = @arch.profiles.select { |profile| profile.profile_family.processor_kind == processor_kind } end |