Class: Contrast::Detective
Instance Method Summary collapse
- #examine(a, b) ⇒ Object
-
#initialize(*args) ⇒ Detective
constructor
A new instance of Detective.
Constructor Details
#initialize(*args) ⇒ Detective
Returns a new instance of Detective.
5 6 7 |
# File 'lib/contrast/detective.rb', line 5 def initialize(*args) @fields = args end |
Instance Method Details
#examine(a, b) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/contrast/detective.rb', line 9 def examine(a, b) Hash[fields_that_do_not_match(a, b).map do |key| [key, { :actual_value => get_the_value(a, key), :expected_value => get_the_value(b, key) }] end] end |