Class: Dbsketch::Comparison::ViewComparator
- Inherits:
-
Object
- Object
- Dbsketch::Comparison::ViewComparator
- Defined in:
- lib/dbsketch/comparison/view_comparator.rb
Instance Method Summary collapse
Instance Method Details
#are_equivalent?(old_view, new_view) ⇒ Boolean
35 36 37 38 39 40 41 |
# File 'lib/dbsketch/comparison/view_comparator.rb', line 35 def are_equivalent? old_view, new_view ### Preconditions raise ArgumentError, "old_view is not a Dbsketch::Model::View" unless nil == old_view or old_view.is_a? Dbsketch::Model::View raise ArgumentError, "new_view is not a Dbsketch::Model::View" unless nil == new_view or new_view.is_a? Dbsketch::Model::View ### (nil != old_view and nil != new_view) and (old_view.query == new_view.query) end |
#compare(old_view, new_view) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/dbsketch/comparison/view_comparator.rb', line 43 def compare old_view, new_view ### Preconditions raise ArgumentError, "old_view is not a Dbsketch::Model::View" unless nil == old_view or old_view.is_a? Dbsketch::Model::View raise ArgumentError, "new_view is not a Dbsketch::Model::View" unless nil == new_view or new_view.is_a? Dbsketch::Model::View ### ViewDiff.new(old_view, new_view) if not are_equivalent? old_view, new_view end |