Module: Kernel

Defined in:
lib/nasty/kernel.rb

Instance Method Summary collapse

Instance Method Details

#using(resource, &block) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/nasty/kernel.rb', line 2

def using(resource, &block)
  begin
    block.call
  ensure
    resource.dispose
  end
end