lib/dalli/key_manager.rb
##
# Validates the key, and transforms as needed.
#
# If the key is nil or empty, raises ArgumentError.  Whitespace
# characters are allowed for historical reasons, but likely shouldn't
# be used.
# If the key (with namespace) is shorter than the memcached maximum
# allowed key length, just returns the argument key
# Otherwise computes a "truncated" key that uses a truncated prefix
# combined with a 32-byte hex digest of the whole key.
##
Validates the key, and transforms as needed.
If the key is nil or empty, raises ArgumentError.  Whitespace
characters are allowed for historical reasons, but likely shouldn't
be used.
If the key (with namespace) is shorter than the memcached maximum
allowed key length, just returns the argument key
Otherwise computes a "truncated" key that uses a truncated prefix
combined with a 32-byte hex digest of the whole key.
Validates the key and transforms as needed . If the key is nil or empty raises ArgumentError . Whitespace characters are allowed for historical reasons but likely shouldn ' t be used . If the key ( with namespace ) is shorter than the memcached maximum allowed key length just returns the argument key Otherwise computes a " truncated " key that uses a truncated prefix combined with a 32 - byte hex digest of the whole key .
def validate_key(key)
      raise ArgumentError, 'key cannot be blank' unless key&.length&.positive?
      key = key_with_namespace(key)
      key.length > MAX_KEY_LENGTH ? truncated_key(key) : key
    end
def validate_key ( key ) raise ArgumentError , 'key cannot be blank' unless key &. length &. positive? key = key_with_namespace ( key ) key . length > MAX_KEY_LENGTH ? truncated_key ( key ) : key end
Validates the key, and transforms as needed.
Validates the key and transforms as needed .
key
<not_specific>