Sha256: 22a058d0bb5906e488d3902440da388219f3f41123b66fecedea47d21f0d5308

Contents?: true

Size: 626 Bytes

Versions: 13

Compression:

Stored size: 626 Bytes

Contents

require "sdbm"

module Moneta
  module Adapters
    class SDBM < ::SDBM
      include Moneta::Defaults

      def initialize(options = {})
        raise "No :file options specified" unless file = options[:file]
        super(file)
      end

      def [](key)
        if val = super(key_for(key))
          deserialize(val)
        end
      end

      def store(key, value, *)
        super(key_for(key), serialize(value))
      end

      def key?(key, *)
        super(key_for(key))
      end

      def delete(key, *)
        if val = super(key_for(key))
          deserialize(val)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
moneta-splattael-0.7.0 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.2.0 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.1.1 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.1.0 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.0.6 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.0.5 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.0.4 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.0.3 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.0.2 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.0.1 lib/moneta/adapters/sdbm.rb
dkastner-moneta-1.0.0 lib/moneta/adapters/sdbm.rb
dkastner-moneta-0.7.0 lib/moneta/adapters/sdbm.rb
thoughtless-moneta-0.6.0.2 lib/moneta/adapters/sdbm.rb