Sha256: 6adae425259a55b98dc5a0a99b3e043e2073af7ee020bfe740bf4625d698f050

Contents?: true

Size: 440 Bytes

Versions: 6

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

module ROM
  # @api private
  class Transaction
    # @api private
    Rollback = Class.new(StandardError)

    # @api private
    def run(opts = EMPTY_HASH)
      yield(self)
    rescue Rollback
      # noop
    end

    # Unconditionally roll back the current transaction
    #
    # @api public
    def rollback!
      raise Rollback
    end

    # @api private
    NoOp = Transaction.new.freeze
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rom-core-5.1.2 lib/rom/transaction.rb
rom-core-5.1.1 lib/rom/transaction.rb
rom-core-5.1.0 lib/rom/transaction.rb
rom-core-5.0.2 lib/rom/transaction.rb
rom-core-5.0.1 lib/rom/transaction.rb
rom-core-5.0.0 lib/rom/transaction.rb