Class: RedisBackedModel::SortedSet
- Inherits:
-
Object
- Object
- RedisBackedModel::SortedSet
- Defined in:
- lib/redis_backed_model/sorted_set.rb
Instance Method Summary collapse
-
#initialize(model, model_id, definition) ⇒ SortedSet
constructor
A new instance of SortedSet.
-
#to_redis ⇒ Object
Serializes the object as a redis command to create a sorted set.
Constructor Details
#initialize(model, model_id, definition) ⇒ SortedSet
Returns a new instance of SortedSet.
7 8 9 10 11 12 |
# File 'lib/redis_backed_model/sorted_set.rb', line 7 def initialize(model, model_id, definition) self.model = model self.model_id = model_id self.definition = definition self end |
Instance Method Details
#to_redis ⇒ Object
Serializes the object as a redis command to create a sorted set.
15 16 17 |
# File 'lib/redis_backed_model/sorted_set.rb', line 15 def to_redis "zadd|#{key}|#{score}|#{member}" end |