Method: Momento::CollectionTtl.refresh_ttl_if_provided

Defined in:
lib/momento/collection_ttl.rb

.refresh_ttl_if_provided(ttl_seconds = nil) ⇒ Momento::CollectionTtl

Creates a CollectionTtl that sets refresh to true if ttl_seconds is provided and false otherwise

Parameters:

  • ttl_seconds (Integer | nil) (defaults to: nil)

    the time to live of the collection. If not nil, refresh is set to true.

Returns:



46
47
48
# File 'lib/momento/collection_ttl.rb', line 46

def self.refresh_ttl_if_provided(ttl_seconds = nil)
  new(ttl_seconds, refresh_ttl: !ttl_seconds.nil?)
end