Parent

Methods

Class/Module Index [+]

Quicksearch

Volatile::Raw

Implementation detail. Not intended for direct instantiation.

Public Class Methods

new() click to toggle source

Implementation detail.

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

Public Instance Methods

get(key) click to toggle source

Implementation detail.

# File lib/volatiledb.rb, line 143
def get(key)
  handle = @db[key]
  f = "/tmp/#{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 133
def put(key, data)
  handle = handle_from key
  File.open("/tmp/#{handle}", "w") {|f| f << data}
  @db[key] = handle
  key
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.