Class: ROM::Transaction Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/transaction.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

Rollback =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Class.new(StandardError)
NoOp =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Transaction.new.freeze

Instance Method Summary collapse

Instance Method Details

#rollback!Object

Unconditionally roll back the current transaction

Raises:


19
20
21
# File 'lib/rom/transaction.rb', line 19

def rollback!
  raise Rollback
end

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


10
11
12
13
14
# File 'lib/rom/transaction.rb', line 10

def run(**)
  yield(self)
rescue Rollback
  # noop
end