Sha256: 4e892345932afd455fcc1858260bf3b0917141aa2359cedc72c5b86ee2c01ecd

Contents?: true

Size: 441 Bytes

Versions: 9

Compression:

Stored size: 441 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

9 entries across 9 versions & 1 rubygems

Version Path
rom-core-5.3.2 lib/rom/transaction.rb
rom-core-5.3.1 lib/rom/transaction.rb
rom-core-5.3.0 lib/rom/transaction.rb
rom-core-5.2.6 lib/rom/transaction.rb
rom-core-5.2.5 lib/rom/transaction.rb
rom-core-5.2.4 lib/rom/transaction.rb
rom-core-5.2.3 lib/rom/transaction.rb
rom-core-5.2.2 lib/rom/transaction.rb
rom-core-5.2.1 lib/rom/transaction.rb