Class: Kredis::Types::Flag

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

Instance Attribute Summary collapse

Attributes inherited from Proxying

#key, #proxy, #redis

Instance Method Summary collapse

Methods inherited from Proxying

#failsafe, #initialize, proxying

Constructor Details

This class inherits a constructor from Kredis::Types::Proxying

Instance Attribute Details

#expires_inObject

Returns the value of attribute expires_in.



4
5
6
# File 'lib/kredis/types/flag.rb', line 4

def expires_in
  @expires_in
end

Instance Method Details

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



6
7
8
# File 'lib/kredis/types/flag.rb', line 6

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

#marked?Boolean

Returns:

  • (Boolean)


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

def marked?
  exists?
end

#removeObject



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

def remove
  del
end