Sha256: d64c9662240f7aca4a461df4b8946aacdbee81fd6d0ae6ee464f328d0403611e
Contents?: true
Size: 525 Bytes
Versions: 7
Compression:
Stored size: 525 Bytes
Contents
# You'd normally call this a set, but Redis already has another data type for that class Kredis::Types::UniqueList < Kredis::Types::List proxying :multi, :ltrim attr_accessor :typed, :limit def prepend(elements) multi do remove elements super ltrim 0, (limit - 1) if limit end if Array(elements).flatten.any? end def append(elements) multi do remove elements super ltrim (limit - 1), -1 if limit end if Array(elements).flatten.any? end alias << append end
Version data entries
7 entries across 7 versions & 1 rubygems