Module: Blendris

Defined in:
lib/blendris.rb,
lib/blendris/set.rb,
lib/blendris/list.rb,
lib/blendris/node.rb,
lib/blendris/zset.rb,
lib/blendris/model.rb,
lib/blendris/types.rb,
lib/blendris/utils.rb,
lib/blendris/errors.rb,
lib/blendris/string.rb,
lib/blendris/integer.rb,
lib/blendris/accessor.rb,
lib/blendris/reference.rb,
lib/blendris/reference_set.rb,
lib/blendris/reference_base.rb

Defined Under Namespace

Modules: RedisAccessor, Utils Classes: Model, RedisInteger, RedisList, RedisNode, RedisReference, RedisReferenceBase, RedisReferenceSet, RedisSet, RedisSortedSet, RedisString

Constant Summary collapse

VERSION =
'1.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.databaseObject

Returns the value of attribute database.



5
6
7
# File 'lib/blendris/accessor.rb', line 5

def database
  @database
end

.hostObject

Returns the value of attribute host.



5
6
7
# File 'lib/blendris/accessor.rb', line 5

def host
  @host
end

.portObject

Returns the value of attribute port.



5
6
7
# File 'lib/blendris/accessor.rb', line 5

def port
  @port
end

Class Method Details

.flushdbObject

This will delete all keys in the current database. Dangerous!



39
40
41
# File 'lib/blendris/accessor.rb', line 39

def flushdb
  redis.flushdb
end

.redisObject

Retrieve the connection to the current Redis database.



27
28
29
30
31
32
33
34
35
36
# File 'lib/blendris/accessor.rb', line 27

def redis
  parms =
    {
      :host => @host,
      :port => @port,
      :db   => @database
    }

  $_redis_connection ||= Redis.new(parms)
end