Module: BloodContracts::Instrumentation::SessionFinalizer::Basic

Defined in:
lib/blood_contracts/instrumentation/session_finalizer/basic.rb

Overview

Basic implementation of Session finaliazer

Class Method Summary collapse

Class Method Details

.finalize!(instruments, session) ⇒ Nothing

Run the instruments against the session in a loop Pros:

- simplest, obvious logic

Cons:

- failure in one instrument affects the others

Parameters:

  • instruments (Array<Instrument>)

    list of Instruments to run against the session

  • session (Session)

    object that hold information about matching process, argument for Instrument#call

Returns:

  • (Nothing)


21
22
23
# File 'lib/blood_contracts/instrumentation/session_finalizer/basic.rb', line 21

def self.finalize!(instruments, session)
  instruments.each { |i| i.call(session) }
end