Module: TabsTabs::Resolutionable

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
# File 'lib/tabs_tabs/resolutionable.rb', line 4

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#expire(key, timestamp) ⇒ Object



40
41
42
43
44
45
# File 'lib/tabs_tabs/resolutionable.rb', line 40

def expire(key, timestamp)
  return unless TabsTabs::Config.expires?(name)
  resolution_ends_at = timestamp.utc.to_i + to_seconds
  expires_at = resolution_ends_at + TabsTabs::Config.expires_in(name)
  Storage.expireat(key, expires_at)
end