Class: Kredis::Types::Flag

Inherits:
Proxying show all
Includes:
DefaultValues
Defined in:
lib/kredis/types/flag.rb

Instance Attribute Summary collapse

Attributes inherited from Proxying

#key, #proxy

Instance Method Summary collapse

Methods included from DefaultValues

#initialize

Methods inherited from Proxying

#failsafe, #initialize, proxying, #unproxied_redis

Instance Attribute Details

#expires_inObject

Returns the value of attribute expires_in.



8
9
10
# File 'lib/kredis/types/flag.rb', line 8

def expires_in
  @expires_in
end

Instance Method Details

#mark(expires_in: nil, force: true) ⇒ Object



10
11
12
# File 'lib/kredis/types/flag.rb', line 10

def mark(expires_in: nil, force: true)
  set 1, ex: expires_in || self.expires_in, nx: !force
end

#marked?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/kredis/types/flag.rb', line 14

def marked?
  exists?
end

#removeObject



18
19
20
# File 'lib/kredis/types/flag.rb', line 18

def remove
  del
end