module Lingo::Database::SDBMStore

Private Instance Methods

_clear() click to toggle source
# File lib/lingo/database/sdbm_store.rb, line 42
def _clear
  File.delete(*Dir["#{@stofile}{#{EXT.join(',')}}"])
end
_get(key) click to toggle source
# File lib/lingo/database/sdbm_store.rb, line 50
def _get(key)
  val = super
  val && val.encode(ENC)
end
_open() click to toggle source
# File lib/lingo/database/sdbm_store.rb, line 46
def _open
  SDBM.open(@stofile)
end
_set(key, val) click to toggle source
# File lib/lingo/database/sdbm_store.rb, line 55
def _set(key, val)
  if val.length > 950
    warn "Warning: Entry `#{key}' (#{@srcfile}) too long for SDBM. Truncating..."
    val = val[0, 950]
  end

  super
end
uptodate?() click to toggle source
# File lib/lingo/database/sdbm_store.rb, line 38
def uptodate?
  super(@stofile + EXT.last)
end