Class: Rediska::ZSet

Inherits:
Hash
  • Object
show all
Defined in:
lib/rediska/zset.rb

Instance Method Summary collapse

Instance Method Details

#[]=(key, val) ⇒ Object



3
4
5
# File 'lib/rediska/zset.rb', line 3

def []=(key, val)
  super(key, _floatify(val))
end

#increment(key, val) ⇒ Object



7
8
9
# File 'lib/rediska/zset.rb', line 7

def increment(key, val)
  self[key] += _floatify(val)
end

#select_by_score(min, max) ⇒ Object



11
12
13
14
15
# File 'lib/rediska/zset.rb', line 11

def select_by_score(min, max)
  min = _floatify(min, true)
  max = _floatify(max, false)
  reject {|_,v| v < min || v > max }
end