Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/contrast_with.rb
Instance Method Summary collapse
- #contrast_with(other, fields = other.keys) ⇒ Object
- #contrast_with!(other, fields = other.keys) ⇒ Object
Instance Method Details
#contrast_with(other, fields = other.keys) ⇒ Object
2 3 4 5 |
# File 'lib/contrast_with.rb', line 2 def contrast_with(other, fields = other.keys) detective = Contrast::Detective.new(*fields) detective.examine(self, other) end |
#contrast_with!(other, fields = other.keys) ⇒ Object
7 8 9 10 |
# File 'lib/contrast_with.rb', line 7 def contrast_with!(other, fields = other.keys) results = self.contrast_with(other, fields) raise Contrast::MatchingException.new(results) if results.any? end |