Class: Necropsy::GraphSelfCheck
- Inherits:
-
Object
- Object
- Necropsy::GraphSelfCheck
- Defined in:
- lib/necropsy/graph_self_check.rb
Defined Under Namespace
Classes: Failure
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(report) ⇒ GraphSelfCheck
constructor
A new instance of GraphSelfCheck.
- #validate! ⇒ Object
Constructor Details
#initialize(report) ⇒ GraphSelfCheck
Returns a new instance of GraphSelfCheck.
7 8 9 |
# File 'lib/necropsy/graph_self_check.rb', line 7 def initialize(report) @report = report end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/necropsy/graph_self_check.rb', line 11 def call [ *resolution_issues, *derived_site_issues, *edge_issues, *finding_issues ].sort_by { |issue| BoundedCanonicalizer.dump(issue) } end |
#validate! ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/necropsy/graph_self_check.rb', line 20 def validate! issues = call return true if issues.empty? summary = issues.first(10).map do |issue| "#{issue.fetch('code')}: #{issue.fetch('subject')}" end.join('; ') raise Failure, "Graph self-check failed with #{issues.length} issue(s): #{summary}" end |