Sha256: 3e6a50bb794fba0178d16e910f53abe4374239e4dc328637c8e1ca3a0396cb95

Contents?: true

Size: 461 Bytes

Versions: 7

Compression:

Stored size: 461 Bytes

Contents

require 'sdbm'

module Moneta
  module Adapters
    # SDBM backend
    # @api public
    class SDBM < Memory
      # @param [Hash] options
      # @option options [String] :file Database file
      def initialize(options = {})
        raise ArgumentError, 'Option :file is required' unless options[:file]
        @hash = ::SDBM.new(options[:file])
      end

      # (see Proxy#close)
      def close
        @hash.close
        nil
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
moneta-0.7.9 lib/moneta/adapters/sdbm.rb
moneta-0.7.8 lib/moneta/adapters/sdbm.rb
moneta-0.7.6 lib/moneta/adapters/sdbm.rb
moneta-0.7.5 lib/moneta/adapters/sdbm.rb
moneta-0.7.4 lib/moneta/adapters/sdbm.rb
moneta-0.7.3 lib/moneta/adapters/sdbm.rb
moneta-0.7.2 lib/moneta/adapters/sdbm.rb