allow easier, single-file options for TC and TDB
[metropolis.git] / lib / metropolis / tdb / single.rb
blob840b57acce137f3017f0c92c83d6088e598f5f13
1 # -*- encoding: binary -*-
2 module Metropolis::TDB::Single
3   def self.extended(obj)
4     obj.instance_eval do
5       @db = ::TDB.new(@uri.path, @tdb_opts)
6     end
7   end
9   def db(key, &block)
10     yield @db
11   end
13   def close!
14     @db.close
15   end
16 end