Sha256: d644b45073723f7990738f3d9afe24aba1a36802390898225e1dd3bfcf64e986

Contents?: true

Size: 266 Bytes

Versions: 5

Compression:

Stored size: 266 Bytes

Contents

module Rubeus::Jdbc
  module CloseableResource
    def with_close(resource)
      if block_given?
        begin
          yield(resource) 
        ensure
          resource.close
        end
        return nil
      else
        resource
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubeus-0.0.8-java lib/rubeus/jdbc/closeable_resource.rb
rubeus-0.0.4-java lib/rubeus/jdbc/closeable_resource.rb
rubeus-0.0.5-java lib/rubeus/jdbc/closeable_resource.rb
rubeus-0.0.7-java lib/rubeus/jdbc/closeable_resource.rb
rubeus-0.0.6-java lib/rubeus/jdbc/closeable_resource.rb