Class: ROM::SQL::Transaction Private
- Inherits:
-
Transaction
- Object
- Transaction
- ROM::SQL::Transaction
- Defined in:
- lib/rom/sql/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.
Instance Method Summary collapse
-
#initialize(connection) ⇒ Transaction
constructor
private
A new instance of Transaction.
- #run(**options) ⇒ Object private
Constructor Details
#initialize(connection) ⇒ Transaction
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.
Returns a new instance of Transaction.
12 13 14 |
# File 'lib/rom/sql/transaction.rb', line 12 def initialize(connection) @connection = connection end |
Instance Method Details
#run(**options) ⇒ Object
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.
16 17 18 19 20 |
# File 'lib/rom/sql/transaction.rb', line 16 def run(**) connection.transaction() { yield(self) } rescue ::ROM::Transaction::Rollback # noop end |