class Dbsketch::Comparison::Diff
Attributes
new_value[R]
old_value[R]
Public Class Methods
new(old_value, new_value)
click to toggle source
# File lib/dbsketch/comparison/diff.rb, line 9 def initialize old_value, new_value ### Preconditions raise ArgumentError, "new_value is not different from old_value" unless new_value != old_value ### @old_value = old_value @new_value = new_value end
Public Instance Methods
addition?()
click to toggle source
Returns true if the diff represents the addition of a new value
# File lib/dbsketch/comparison/diff.rb, line 30 def addition? nil == @old_value and nil != @new_value end
change?()
click to toggle source
Returns true if the diff represents a change
# File lib/dbsketch/comparison/diff.rb, line 25 def change? nil != @old_value and nil != @new_value end
deletion?()
click to toggle source
Returns true if the diff represents the deletion of an old value
# File lib/dbsketch/comparison/diff.rb, line 20 def deletion? nil != @old_value and nil == @new_value end