From b9d22ea98cf524b1e59082bdb930f0a28b5c0401 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Tue, 2 Feb 2010 15:15:10 +0100 Subject: [PATCH] DB: Recno/Queue-support --- lib/sbdb/db.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/sbdb/db.rb b/lib/sbdb/db.rb index 3ae9e99..f060815 100644 --- a/lib/sbdb/db.rb +++ b/lib/sbdb/db.rb @@ -88,6 +88,14 @@ module SBDB def self.new file, name = nil, *p, &e super file, name, RECNO, *p, &e end + + def [] k + super [k].pack('I') + end + + def []= k, v + super [k].pack('I'), v + end end Array = Recno @@ -95,5 +103,13 @@ module SBDB def self.new file, name = nil, *p, &e super file, name, QUEUE, *p, &e end + + def [] k + super [k].pack('I') + end + + def []= k, v + super [k].pack('I'), v + end end end