Class: Lorentz
- Inherits:
-
Object
- Object
- Lorentz
- Defined in:
- lib/lorentz.rb,
lib/lorentz/version.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Lorentz
constructor
A new instance of Lorentz.
Methods included from Keys
#del, #exists, #keys, #randomkey, #rename, #renamenx
Methods included from Glob
Methods included from Strings
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
#db ⇒ Object (readonly)
Returns the value of attribute db.
8 9 10 |
# File 'lib/lorentz.rb', line 8 def db @db end |
Class Method Details
.version ⇒ Object
3 4 5 |
# File 'lib/lorentz/version.rb', line 3 def version "0.0.1".freeze end |