Class: DatastoreRedis::RedisString
- Inherits:
-
Object
- Object
- DatastoreRedis::RedisString
- Defined in:
- app/models/datastore_redis/redis_string.rb
Class Method Summary collapse
- .all ⇒ Object
- .create(key, value) ⇒ Object
- .destroy(key) ⇒ Object
- .destroy_all ⇒ Object
- .find(key) ⇒ Object
- .update(key, value) ⇒ Object
Class Method Details
.all ⇒ Object
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_all ⇒ Object
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 |