Sha256: 8434ad96b9d39950dd9b2a97607bbe9698ac7f4f100b3d7a34dfc74fe69c001c
Contents?: true
Size: 502 Bytes
Versions: 1
Compression:
Stored size: 502 Bytes
Contents
require 'oj' module Penumbra class Index attr_reader :path def initialize(path) @path = path db end def keys db.keys.sort end def values db.values end def get(key) db[key] end def put(key, value) db[key] = value end def db @db ||= File.exist?(path) ? Oj.load(File.read(path)) : {} end def close file = File.open(path, 'w') file.write(Oj.dump(db)) file.close end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
penumbra-0.1.1 | lib/penumbra/index.rb |