Parent

Methods

Class/Module Index [+]

Quicksearch

Volatile::Raw

Implementation detail. Not intended for direct instantiation.

Public Class Methods

new(path) click to toggle source

Implementation detail.

# File lib/volatiledb.rb, line 126
def initialize(path)
                    @path = path
  @db ||= {}
end

Public Instance Methods

get(key) click to toggle source

Implementation detail.

# File lib/volatiledb.rb, line 144
def get(key)
  handle = @db[key]
  f = path handle
  if File.file?(f)
    File.read f
  else
    nil
  end
end
put(key, data) click to toggle source

Implementation detail.

# File lib/volatiledb.rb, line 134
def put(key, data)
  handle = handle_from key
  File.open(path(handle), "w") {|f| f << data}
  @db[key] = handle
  key
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.