Module: Tractor
- Defined in:
- lib/tractor/model/base.rb,
lib/tractor/model/mapper.rb
Defined Under Namespace
Modules: Model Classes: Association, DuplicateKeyError, Index, MissingIdError, MissingIndexError
Class Attribute Summary collapse
-
.redis ⇒ Object
readonly
Returns the value of attribute redis.
Class Method Summary collapse
-
.connectdb(options = {}) ⇒ Object
important options are port, host and db.
- .flushdb ⇒ Object
Class Attribute Details
.redis ⇒ Object (readonly)
Returns the value of attribute redis.
9 10 11 |
# File 'lib/tractor/model/base.rb', line 9 def redis @redis end |
Class Method Details
.connectdb(options = {}) ⇒ Object
important options are port, host and db
12 13 14 |
# File 'lib/tractor/model/base.rb', line 12 def connectdb(={}) @redis = .nil? ? Redis.new(:db => 1) : Redis.new() end |
.flushdb ⇒ Object
16 17 18 |
# File 'lib/tractor/model/base.rb', line 16 def flushdb @redis.flushdb end |