Class: Contrast::Detective

Inherits:
Object show all
Defined in:
lib/contrast/detective.rb

Instance Method Summary collapse

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