Class: RedisBackedModel::SortedSet

Inherits:
Object
  • Object
show all
Defined in:
lib/redis_backed_model/sorted_set.rb

Instance Method Summary collapse

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_redisObject

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