Class: Suture::Surgeon::Auditor

Inherits:
Object
  • Object
show all
Includes:
Adapter::Log
Defined in:
lib/suture/surgeon/auditor.rb

Instance Method Summary collapse

Methods included from Adapter::Log

#log_debug, #log_error, #log_info, #log_warn, logger, reset!

Constructor Details

#initializeAuditor

Returns a new instance of Auditor.



10
11
12
# File 'lib/suture/surgeon/auditor.rb', line 10

def initialize
  @scalpel = Suture::Util::Scalpel.new
end

Instance Method Details

#operate(plan) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/suture/surgeon/auditor.rb', line 14

def operate(plan)
  new_result = result_for(plan, :new)
  old_result = result_for(plan, :old)
  if !comparable?(plan, old_result, new_result)
    handle_mismatch(plan, old_result, new_result)
  else
    return_result(new_result)
  end
end