Class: Udb::ProcCertModel::Requirement
- Inherits:
-
Object
- Object
- Udb::ProcCertModel::Requirement
- Defined in:
- lib/udb/obj/certificate.rb
Overview
Holds extra requirements not associated with extensions or their parameters.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(data, arch) ⇒ Requirement
constructor
A new instance of Requirement.
- #name ⇒ Object
- #when ⇒ Object
- #when_pretty ⇒ Object
Constructor Details
#initialize(data, arch) ⇒ Requirement
Returns a new instance of Requirement.
68 69 70 71 72 73 74 |
# File 'lib/udb/obj/certificate.rb', line 68 def initialize(data, arch) raise ArgumentError, "Bad data" unless data.is_a?(Hash) raise ArgumentError, "Need Architecture class but it's a #{arch.class}" unless arch.is_a?(Architecture) @data = data @arch = arch end |
Instance Method Details
#description ⇒ Object
77 |
# File 'lib/udb/obj/certificate.rb', line 77 def description = @data["description"] |
#name ⇒ Object
76 |
# File 'lib/udb/obj/certificate.rb', line 76 def name = @data["name"] |
#when ⇒ Object
78 |
# File 'lib/udb/obj/certificate.rb', line 78 def when = @data["when"] |
#when_pretty ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/udb/obj/certificate.rb', line 80 def when_pretty @data["when"].keys.map do |key| case key when "xlen" "XLEN == #{@data["when"]["xlen"]}" when "param" @data["when"]["param"].map do |param_name, param_value| "Parameter #{param_name} == #{param_value}" end else raise "Type #{key} not implemented" end end.flatten.join(" and ") end |