Sha256: 9b383407d030c6c4c1a051fa0200281d58dc5f471c976a41acf89e9619c266e0
Contents?: true
Size: 406 Bytes
Versions: 7
Compression:
Stored size: 406 Bytes
Contents
module Moneta # @api private module IncrementSupport # (see Defaults#increment) def increment(key, amount = 1, options = {}) existing = load(key, options) value = (existing == nil ? 0 : Integer(existing)) + amount store(key, value.to_s, options) value end def self.included(base) base.supports(:increment) if base.respond_to?(:supports) end end end
Version data entries
7 entries across 7 versions & 1 rubygems