Class: Lorentz

Inherits:
Object
  • Object
show all
Includes:
Keys, Strings
Defined in:
lib/lorentz.rb,
lib/lorentz/version.rb

Defined Under Namespace

Modules: Glob, Keys, Strings

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Keys

#del, #exists, #keys, #randomkey, #rename, #renamenx

Methods included from Glob

compile

Methods included from Strings

#append, #get, #set, #strlen

Constructor Details

#initialize(opts = {}) ⇒ Lorentz

Returns a new instance of Lorentz.



9
10
11
12
13
14
15
16
17
18
# File 'lib/lorentz.rb', line 9

def initialize(opts={})
  db_name = opts.delete(:db) || 0

  @db = begin
          ::Maglev::PERSISTENT_ROOT[:"lorentz_db_#{db_name}"] ||= {}
        rescue
          $stderr.puts "Maglev only"
          exit
        end
end

Instance Attribute Details

#dbObject (readonly)

Returns the value of attribute db.



8
9
10
# File 'lib/lorentz.rb', line 8

def db
  @db
end

Class Method Details

.versionObject



3
4
5
# File 'lib/lorentz/version.rb', line 3

def version
  "0.0.1".freeze
end