Sha256: f020eee673a88f35dabe191bf163841404d41dc102b9a9735314bf87f095902d

Contents?: true

Size: 959 Bytes

Versions: 7

Compression:

Stored size: 959 Bytes

Contents

# rubocop:disable all

class Familia::RedisType

  # Must be included in all RedisType classes to provide Redis
  # commands. The class must have a rediskey method.
  module Commands

    def move(db)
      redis.move rediskey, db
    end

    def rename(newkey)
      redis.rename rediskey, newkey
    end

    def renamenx(newkey)
      redis.renamenx rediskey, newkey
    end

    def type
      redis.type rediskey
    end

    def delete!
      redis.del rediskey
    end
    alias clear delete!
    alias del delete!

    def exists?
      redis.exists(rediskey) && !size.zero?
    end

    def realttl
      redis.ttl rediskey
    end

    def expire(sec)
      redis.expire rediskey, sec.to_i
    end

    def expireat(unixtime)
      redis.expireat rediskey, unixtime
    end

    def persist
      redis.persist rediskey
    end

    def echo(meth, trace)
      redis.echo "[#{self.class}\##{meth}] #{trace} (#{@opts[:class]}\#)"
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
familia-1.0.0.pre.rc7 lib/familia/redistype/commands.rb
familia-1.0.0.pre.rc6 lib/familia/redistype/commands.rb
familia-1.0.0.pre.rc5 lib/familia/redistype/commands.rb
familia-1.0.0.pre.rc4 lib/familia/redistype/commands.rb
familia-1.0.0.pre.rc3 lib/familia/redistype/commands.rb
familia-1.0.0.pre.rc2 lib/familia/redistype/commands.rb
familia-1.0.0.pre.rc1 lib/familia/redistype/commands.rb