Class: Udb::CertNormativeRule
- Inherits:
-
Object
- Object
- Udb::CertNormativeRule
- Defined in:
- lib/udb/cert_normative_rule.rb
Instance Method Summary collapse
-
#description ⇒ String
Description of normative rule (could be multiple lines).
-
#doc_links ⇒ Array<DocLink>
List of certification point documentation links.
-
#id ⇒ String
Unique ID of the normative rule.
-
#initialize(data, db_obj) ⇒ CertNormativeRule
constructor
A new instance of CertNormativeRule.
Constructor Details
#initialize(data, db_obj) ⇒ CertNormativeRule
Returns a new instance of CertNormativeRule.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/udb/cert_normative_rule.rb', line 10 def initialize(data, db_obj) raise ArgumentError, "Need Hash but was passed a #{data.class}" unless data.is_a?(Hash) raise ArgumentError, "Need DatabaseObject but was passed a #{db_obj.class}" unless db_obj.is_a?(DatabaseObject) @data = data @db_obj = db_obj raise ArgumentError, "Missing certification normative rule description for #{db_obj.name} of kind #{db_obj.kind}" if description.nil? raise ArgumentError, "Missing certification normative rule ID for #{db_obj.name} of kind #{db_obj.kind}" if id.nil? end |
Instance Method Details
#description ⇒ String
Returns Description of normative rule (could be multiple lines).
22 |
# File 'lib/udb/cert_normative_rule.rb', line 22 def description = @data["description"] |
#doc_links ⇒ Array<DocLink>
Returns List of certification point documentation links.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/udb/cert_normative_rule.rb', line 28 def doc_links return @doc_links unless @doc_links.nil? @doc_links = [] @data["doc_links"]&.each do |dst| @doc_links << DocLink.new(dst, @db_obj) end raise "Missing doc_links for certification normative rule ID '#{id}' of kind #{@db_obj.kind}" if @doc_links.empty? @doc_links end |
#id ⇒ String
Returns Unique ID of the normative rule.
25 |
# File 'lib/udb/cert_normative_rule.rb', line 25 def id = @data["id"] |