summaryrefslogtreecommitdiff
path: root/lib/metropolis/tdb/single.rb
blob: 840b57acce137f3017f0c92c83d6088e598f5f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- encoding: binary -*-
module Metropolis::TDB::Single
  def self.extended(obj)
    obj.instance_eval do
      @db = ::TDB.new(@uri.path, @tdb_opts)
    end
  end

  def db(key, &block)
    yield @db
  end

  def close!
    @db.close
  end
end