Class: AbideDevUtils::XCCDF::Diff::NumberTitleDiff

Inherits:
Object
  • Object
show all
Defined in:
lib/abide_dev_utils/xccdf/diff/benchmark/number_title.rb

Overview

Diffs two XCCDF benchmarks using the title / number of the items as the primary diff properties.

Constant Summary collapse

SKIP_DIFF_TYPES =
%i[equal both].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(numbered_children, other_numbered_children) ⇒ NumberTitleDiff

Returns a new instance of NumberTitleDiff.



13
14
15
# File 'lib/abide_dev_utils/xccdf/diff/benchmark/number_title.rb', line 13

def initialize(numbered_children, other_numbered_children)
  new_number_title_objs(numbered_children, other_numbered_children)
end

Instance Attribute Details

#diffObject



17
18
19
# File 'lib/abide_dev_utils/xccdf/diff/benchmark/number_title.rb', line 17

def diff
  @diff ||= find_diffs(@number_title_objs, @other_number_title_objs)
end

Instance Method Details

#to_sObject



21
22
23
24
25
26
27
28
29
# File 'lib/abide_dev_utils/xccdf/diff/benchmark/number_title.rb', line 21

def to_s
  parts = []
  @diff.each do |_, diffs|
    diffs.each do |dh|
      parts << dh[:diff_text]
    end
  end
  parts.join("\n")
end