Class: DatastoreRedis::RedisString

Inherits:
Object
  • Object
show all
Defined in:
app/models/datastore_redis/redis_string.rb

Class Method Summary collapse

Class Method Details

.allObject



4
5
6
# File 'app/models/datastore_redis/redis_string.rb', line 4

def all 
  DatastoreRedis::RedisConnection.connection.keys
end

.create(key, value) ⇒ Object



12
13
14
# File 'app/models/datastore_redis/redis_string.rb', line 12

def create(key, value) 
  DatastoreRedis::RedisConnection.connection[key] = value
end

.destroy(key) ⇒ Object



20
21
22
# File 'app/models/datastore_redis/redis_string.rb', line 20

def destroy(key) 
  DatastoreRedis::RedisConnection.connection.del(key) 
end

.destroy_allObject



24
25
26
# File 'app/models/datastore_redis/redis_string.rb', line 24

def destroy_all 
  DatastoreRedis::RedisConnection.connection.flushall
end

.find(key) ⇒ Object



8
9
10
# File 'app/models/datastore_redis/redis_string.rb', line 8

def find(key) 
  DatastoreRedis::RedisConnection.connection[key]
end

.update(key, value) ⇒ Object



16
17
18
# File 'app/models/datastore_redis/redis_string.rb', line 16

def update(key, value) 
  DatastoreRedis::RedisConnection.connection[key] = value
end