Class: AbideDevUtils::Comply::NodeScanReport
- Inherits:
-
Object
- Object
- AbideDevUtils::Comply::NodeScanReport
- Defined in:
- lib/abide_dev_utils/comply.rb
Overview
Class representation of a Comply node scan report
Constant Summary collapse
- DIFF_PROPERTIES =
%i[passing failing error not_checked informational].freeze
Instance Attribute Summary collapse
-
#benchmark ⇒ Object
readonly
Returns the value of attribute benchmark.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#failing ⇒ Object
readonly
Returns the value of attribute failing.
-
#informational ⇒ Object
readonly
Returns the value of attribute informational.
-
#last_scan ⇒ Object
readonly
Returns the value of attribute last_scan.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#not_checked ⇒ Object
readonly
Returns the value of attribute not_checked.
-
#passing ⇒ Object
readonly
Returns the value of attribute passing.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
Instance Method Summary collapse
- #diff(other) ⇒ Object
-
#initialize(node_name, node_hash) ⇒ NodeScanReport
constructor
A new instance of NodeScanReport.
Constructor Details
#initialize(node_name, node_hash) ⇒ NodeScanReport
Returns a new instance of NodeScanReport.
467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/abide_dev_utils/comply.rb', line 467 def initialize(node_name, node_hash) @name = node_name @hash = node_hash @passing = node_hash.dig('scan_results', 'Pass') || {} @failing = node_hash.dig('scan_results', 'Fail') || {} @error = node_hash.dig('scan_results', 'Error') || {} @not_checked = node_hash.dig('scan_results', 'Not checked') || {} @informational = node_hash.dig('scan_results', 'Informational') || {} @benchmark = node_hash['benchmark'] @last_scan = node_hash['last_scan'] @profile = node_hash.fetch('custom_profile', nil) || node_hash.fetch('profile', nil) create_equality_methods end |
Instance Attribute Details
#benchmark ⇒ Object (readonly)
Returns the value of attribute benchmark.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def benchmark @benchmark end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def error @error end |
#failing ⇒ Object (readonly)
Returns the value of attribute failing.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def failing @failing end |
#informational ⇒ Object (readonly)
Returns the value of attribute informational.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def informational @informational end |
#last_scan ⇒ Object (readonly)
Returns the value of attribute last_scan.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def last_scan @last_scan end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def name @name end |
#not_checked ⇒ Object (readonly)
Returns the value of attribute not_checked.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def not_checked @not_checked end |
#passing ⇒ Object (readonly)
Returns the value of attribute passing.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def passing @passing end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
463 464 465 |
# File 'lib/abide_dev_utils/comply.rb', line 463 def profile @profile end |
Instance Method Details
#diff(other) ⇒ Object
481 482 483 484 485 486 487 |
# File 'lib/abide_dev_utils/comply.rb', line 481 def diff(other) diff = {} DIFF_PROPERTIES.each do |prop| diff[prop] = send("#{prop.to_s}_equal?".to_sym, other.send(prop)) ? {} : property_diff(prop, other) end diff end |