NAME Mojo::Cache::Role::Strict - Require that keys exist when getting cached values or throw STATUS SYNOPSIS my $strict_cache = Mojo::Cache->new->with_roles('+Strict'); $strict_cache->set(key_that_exists => 'I am here!'); # prints "I am here!" say $strict_cache->get('key_that_exists'); # dies say $strict_cache->get('nonexistent_key'); DESCRIPTION Mojo::Cache::Role::Strict is a role that makes your Mojo::Cache instance strict by dying when keys that are provided to "get" in Mojo::Cache do not exist in the cache (have not been set with "set" in Mojo::Cache). METHODS exists if ($cache->exists('key')) { ... } Returns true if a cached value exists for the provided key, false otherwise. "exists" is composed from Mojo::Cache::Role::Exists. See that module for more information. AUTHOR Adam Hopkins COPYRIGHT Copyright 2019- Adam Hopkins LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO * Mojolicious * Mojo::Cache * Mojo::Cache::Role::Exists