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.
      465 466 467 468 469 470 471 472 473 474 475 476 477  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 465 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.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def benchmark @benchmark end  | 
  
#error ⇒ Object (readonly)
Returns the value of attribute error.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def error @error end  | 
  
#failing ⇒ Object (readonly)
Returns the value of attribute failing.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def failing @failing end  | 
  
#informational ⇒ Object (readonly)
Returns the value of attribute informational.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def informational @informational end  | 
  
#last_scan ⇒ Object (readonly)
Returns the value of attribute last_scan.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def last_scan @last_scan end  | 
  
#name ⇒ Object (readonly)
Returns the value of attribute name.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def name @name end  | 
  
#not_checked ⇒ Object (readonly)
Returns the value of attribute not_checked.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def not_checked @not_checked end  | 
  
#passing ⇒ Object (readonly)
Returns the value of attribute passing.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def passing @passing end  | 
  
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
      461 462 463  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 461 def profile @profile end  | 
  
Instance Method Details
#diff(other) ⇒ Object
      479 480 481 482 483 484 485  | 
    
      # File 'lib/abide_dev_utils/comply.rb', line 479 def diff(other) diff = {} DIFF_PROPERTIES.each do |prop| diff[prop] = send("#{prop}_equal?".to_sym, other.send(prop)) ? {} : property_diff(prop, other) end diff end  |