Sha256: 4650cf8fcb6c7a6e2b78e638ee96516ccbd90254a0515a73186ae7f45425af0b

Contents?: true

Size: 337 Bytes

Versions: 6

Compression:

Stored size: 337 Bytes

Contents

package org.embulk.parser.xpath2

import scala.util.control.Exception.ignoring

object LoanPattern {

  type Closable = { def close(): Unit }

  def apply[R <: Closable, A](resource: R)(f: R => A): A = {
    try {
      f(resource)
    } finally {
      ignoring(classOf[Throwable]) apply {
        resource.close()
      }
    }
  }

}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
embulk-parser-xpath2-0.1.1 src/main/scala/org/embulk/parser/xpath2/LoanPattern.scala
embulk-parser-xpath2-0.1.0 src/main/scala/org/embulk/parser/xpath2/LoanPattern.scala
embulk-parser-xpath2-0.0.4 src/main/scala/org/embulk/parser/xpath2/LoanPattern.scala
embulk-parser-xpath2-0.0.3 src/main/scala/org/embulk/parser/xpath2/LoanPattern.scala
embulk-parser-xpath2-0.0.2 src/main/scala/org/embulk/parser/xpath2/LoanPattern.scala
embulk-parser-xpath2-0.0.1 src/main/scala/org/embulk/parser/xpath2/LoanPattern.scala