Sha256: 7fa242e10b49cccd9a58bc4d1549a91d6f00286a8f478778e7ae81d1ff82e819

Contents?: true

Size: 409 Bytes

Versions: 31

Compression:

Stored size: 409 Bytes

Contents

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

31 entries across 31 versions & 2 rubygems

Version Path
rom-core-4.2.1 lib/rom/transaction.rb
rom-core-4.2.0 lib/rom/transaction.rb
rom-core-4.1.2 lib/rom/transaction.rb
rom-core-4.1.1 lib/rom/transaction.rb
rom-core-4.1.0 lib/rom/transaction.rb
rom-core-4.0.2 lib/rom/transaction.rb
rom-core-4.0.1 lib/rom/transaction.rb
rom-3.3.3 lib/rom/transaction.rb
rom-core-4.0.0 lib/rom/transaction.rb
rom-3.3.2 lib/rom/transaction.rb
rom-core-4.0.0.rc2 lib/rom/transaction.rb
rom-core-4.0.0.rc1 lib/rom/transaction.rb
rom-core-4.0.0.beta3 lib/rom/transaction.rb
rom-3.3.1 lib/rom/transaction.rb
rom-core-4.0.0.beta2 lib/rom/transaction.rb
rom-3.3.0 lib/rom/transaction.rb
rom-core-4.0.0.beta1 lib/rom/transaction.rb
rom-3.2.3 lib/rom/transaction.rb
rom-3.2.2 lib/rom/transaction.rb
rom-3.2.1 lib/rom/transaction.rb