class Relix::OrderedIndex
Public Class Methods
new(set, base_name, accessor, options={})
click to toggle source
Calls superclass method
Relix::Index::new
# File lib/relix/indexes/ordered.rb, line 5 def initialize(set, base_name, accessor, options={}) super @order = accessor end
Public Instance Methods
create_query_clause(redis)
click to toggle source
# File lib/relix/indexes/ordered.rb, line 30 def create_query_clause(redis) QueryClause.new(redis, self) end
deindex(r, pk, old_value)
click to toggle source
# File lib/relix/indexes/ordered.rb, line 22 def deindex(r, pk, old_value) r.zrem(sorted_set_name, pk) end
destroy_all(r)
click to toggle source
# File lib/relix/indexes/ordered.rb, line 26 def destroy_all(r) r.del(sorted_set_name) end
index(r, pk, object, value, old_value)
click to toggle source
# File lib/relix/indexes/ordered.rb, line 18 def index(r, pk, object, value, old_value) r.zadd(sorted_set_name, score(object, value), pk) end
sorted_set_name()
click to toggle source
# File lib/relix/indexes/ordered.rb, line 10 def sorted_set_name name end
watch_keys(*values)
click to toggle source
# File lib/relix/indexes/ordered.rb, line 14 def watch_keys(*values) sorted_set_name end