Class: RiskRegistryPage
- Inherits:
-
BaseDocument
- Object
- BaseDocument
- RiskRegistryPage
- Includes:
- RpnRendering
- Defined in:
- lib/almirah/doc_types/risk_registry_page.rb
Overview
The registry page (ADR-216): build/risks/
Constant Summary collapse
- STATUS_COLUMN =
'Status'- AFFECTED_DOCUMENTS_COLUMN =
The column rendered as bare linked IDs from the record's Affected Documents section (ADR-218), never as the section's prose.
'Affected Documents'
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#preface ⇒ Object
Returns the value of attribute preface.
-
#records ⇒ Object
Returns the value of attribute records.
-
#registry ⇒ Object
Returns the value of attribute registry.
-
#rpn_groups ⇒ Object
Returns the value of attribute rpn_groups.
Attributes inherited from BaseDocument
#dom, #headings, #id, #output_rel_path, #title
Instance Method Summary collapse
-
#initialize(registry, records, preface, columns, rpn_groups = []) ⇒ RiskRegistryPage
constructor
columnsis the configured per-registry list (ADR-216); nil means the registry is not configured and gets the implicit columns plus Status only. - #to_console ⇒ Object
- #to_html(output_file_path) ⇒ Object
Methods included from RpnRendering
#format_rpn, #rpn_threshold_class
Methods inherited from BaseDocument
#critical_chain_link, #decisions_link, #home_link, #index_link, #needs_chartjs?, #rel_to, #risks_link, #save_html_to_file
Constructor Details
#initialize(registry, records, preface, columns, rpn_groups = []) ⇒ RiskRegistryPage
columns is the configured per-registry list (ADR-216); nil means the
registry is not configured and gets the implicit columns plus Status only.
rpn_groups (ADR-217) appends one computed "
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 27 def initialize(registry, records, preface, columns, rpn_groups = []) super() @registry = registry @records = records @preface = preface @columns = columns.nil? ? [STATUS_COLUMN] : columns @rpn_groups = rpn_groups @id = 'overview' @title = preface_title || "Risk Registry: #{registry}" end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
21 22 23 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 21 def columns @columns end |
#preface ⇒ Object
Returns the value of attribute preface.
21 22 23 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 21 def preface @preface end |
#records ⇒ Object
Returns the value of attribute records.
21 22 23 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 21 def records @records end |
#registry ⇒ Object
Returns the value of attribute registry.
21 22 23 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 21 def registry @registry end |
#rpn_groups ⇒ Object
Returns the value of attribute rpn_groups.
21 22 23 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 21 def rpn_groups @rpn_groups end |
Instance Method Details
#to_console ⇒ Object
38 39 40 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 38 def to_console puts "\e[36mRisk Registry: #{@registry}\e[0m" end |
#to_html(output_file_path) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/almirah/doc_types/risk_registry_page.rb', line 42 def to_html(output_file_path) html_rows = [''] html_rows.concat preface_html html_rows.append render_register_table save_html_to_file(html_rows, nil, output_file_path) end |