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(opts = EMPTY_HASH) ⇒ 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.
10 11 12 |
# File 'lib/rom/sql/transaction.rb', line 10 def initialize(connection) @connection = connection end |
Instance Method Details
#run(opts = EMPTY_HASH) ⇒ 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.
14 15 16 17 18 |
# File 'lib/rom/sql/transaction.rb', line 14 def run(opts = EMPTY_HASH) connection.transaction(opts) { yield(self) } rescue ::ROM::Transaction::Rollback # noop end |