File: Filters.pm

package info (click to toggle)
libmason-plugin-cache-perl 0.05-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 132 kB
  • sloc: perl: 203; makefile: 7
file content (16 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package Mason::Plugin::Cache::Filters;
BEGIN {
  $Mason::Plugin::Cache::Filters::VERSION = '0.05';
}
use Mason::PluginRole;

method Cache ( $key, $set_options, %cache_options ) {
    $key = 'Default' if !defined($key);
    Mason::DynamicFilter->new(
        filter => sub {
            $self->cache(%cache_options)->compute( $key, $_[0], $set_options );
        }
    );
}

1;