Class: Transaction::Simple::ThreadSafe::Group
- Defined in:
- lib/extensions/pdf-writer/transaction/simple/threadsafe/group.rb
Overview
A transaction group is an object wrapper that manages a group of objects as if they were a single object for the purpose of transaction management. All transactions for this group of objects should be performed against the transaction group object, not against individual objects in the group. This is the threadsafe version of a transaction group.
Instance Attribute Summary
Attributes inherited from Group
Instance Method Summary collapse
-
#initialize(*objects) ⇒ Group
constructor
A new instance of Group.
Methods inherited from Group
#abort_transaction, #clear, #commit_transaction, #rewind_transaction, #start_transaction, #transaction, #transaction_name, #transaction_open?
Constructor Details
#initialize(*objects) ⇒ Group
Returns a new instance of Group.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/extensions/pdf-writer/transaction/simple/threadsafe/group.rb', line 23 def initialize(*objects) @objects = objects || [] @objects.freeze @objects.each { |obj| obj.extend(Transaction::Simple::ThreadSafe) } if block_given? begin yield self ensure self.clear end end end |