Class: Mxrb::Compare::Comparator
- Inherits:
-
Object
- Object
- Mxrb::Compare::Comparator
- Defined in:
- lib/mxrb/compare.rb
Instance Method Summary collapse
- #compare ⇒ Object
-
#initialize(left_path, right_path) ⇒ Comparator
constructor
A new instance of Comparator.
Constructor Details
#initialize(left_path, right_path) ⇒ Comparator
Returns a new instance of Comparator.
21 22 23 24 |
# File 'lib/mxrb/compare.rb', line 21 def initialize(left_path, right_path) @left_path = left_path @right_path = right_path end |
Instance Method Details
#compare ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/mxrb/compare.rb', line 26 def compare left = snapshot(@left_path) right = snapshot(@right_path) changes = diff_values(left, right) Result.new( differences: changes.map { format_change(_1) }.freeze, changes: changes.freeze ) end |