class Cacchern::IncrementableSortedSet

Public Instance Methods

increment(value) click to toggle source
# File lib/cacchern/incrementable_sorted_set.rb, line 7
def increment(value)
  return false unless value.instance_of?(self.class.contain_class)

  if value.valid?
    Redis.current.zincrby @key, value.value, value.key
    true
  else
    false
  end
end
increment_all(values) click to toggle source
# File lib/cacchern/incrementable_sorted_set.rb, line 18
def increment_all(values)
  values.each { |value| increment(value) }
end