Sha256: 9b46e1c380cc6925185e0341665b7986323d55a4226a9cde40eb5144d2b96386
Contents?: true
Size: 461 Bytes
Versions: 10
Compression:
Stored size: 461 Bytes
Contents
# frozen_string_literal: true require 'cacchern/sorted_set' module Cacchern class IncrementableSortedSet < Cacchern::SortedSet 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 def increment_all(values) values.each { |value| increment(value) } end end end
Version data entries
10 entries across 10 versions & 1 rubygems