Class: AbideDevUtils::XCCDF::Diff::DiffChangeResult
- Inherits:
-
Object
- Object
- AbideDevUtils::XCCDF::Diff::DiffChangeResult
- Defined in:
- lib/abide_dev_utils/xccdf/diff/utils.rb
Overview
Holds the result of a diff on a per-item basis.
Instance Attribute Summary collapse
-
#new_value ⇒ Object
readonly
Returns the value of attribute new_value.
-
#old_value ⇒ Object
readonly
Returns the value of attribute old_value.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, old_value, new_value) ⇒ DiffChangeResult
constructor
A new instance of DiffChangeResult.
- #to_a ⇒ Object
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(type, old_value, new_value) ⇒ DiffChangeResult
Returns a new instance of DiffChangeResult.
10 11 12 13 14 |
# File 'lib/abide_dev_utils/xccdf/diff/utils.rb', line 10 def initialize(type, old_value, new_value) @type = type @old_value = old_value @new_value = new_value end |
Instance Attribute Details
#new_value ⇒ Object (readonly)
Returns the value of attribute new_value.
8 9 10 |
# File 'lib/abide_dev_utils/xccdf/diff/utils.rb', line 8 def new_value @new_value end |
#old_value ⇒ Object (readonly)
Returns the value of attribute old_value.
8 9 10 |
# File 'lib/abide_dev_utils/xccdf/diff/utils.rb', line 8 def old_value @old_value end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/abide_dev_utils/xccdf/diff/utils.rb', line 8 def type @type end |
Instance Method Details
#to_a ⇒ Object
20 21 22 |
# File 'lib/abide_dev_utils/xccdf/diff/utils.rb', line 20 def to_a [type, old_value, new_value] end |
#to_h ⇒ Object
16 17 18 |
# File 'lib/abide_dev_utils/xccdf/diff/utils.rb', line 16 def to_h { type: type, old_value: old_value, new_value: new_value } end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/abide_dev_utils/xccdf/diff/utils.rb', line 24 def to_s "#{type}: #{old_value} -> #{new_value}" end |