Class | Pool |
In: |
lib/more/facets/pool.rb
|
Parent: | Array |
Obtains an object, passes it to a block for processing and restores it to the pool.
# File lib/more/facets/pool.rb, line 65 def obtain result = nil begin obj = pop() result = yield(obj) ensure push(obj) end return result end