<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Wikibase::Cache::Backend - Abstract class for Wikibase::Cache backend.

SYNOPSIS
     use Wikibase::Cache::Backend;

     my $obj = Wikibase::Cache::Backend-&gt;new;
     my $value = $obj-&gt;get($type, $key);
     my $saved_value = $obj-&gt;save($type, $key, $value);

DESCRIPTION
    Abstract class for Wikibase::Cache backend. Methods, which needs to
    implement are: "_get()" and "_save()".

METHODS
  "new"
     my $obj = Wikibase::Cache::Backend-&gt;new;

    Constructor.

    Returns instance of object.

  "get"
     my $value = $obj-&gt;get($type, $key);

    Get cache value for $type and $key. Possible types are 'description' and
    'label'.

    Returns string.

  "save"
     my $saved_value = $obj-&gt;save($type, $key, $value);

    Save cache value for $type and $key. Value will be set to $value.
    Possible types are 'description' and 'label'.

    Returns string.

ERRORS
     new():
             From Class::Utils::set_params():
                     Unknown parameter '%s'.

     get():
             This is abstract class. You need to implement '_get' method.
             Type '%s' isn't supported.
             Type must be defined.';

     save():
             This is abstract class. You need to implement '_save' method.
             Type '%s' isn't supported.
             Type must be defined.';

EXAMPLE
     use strict;
     use warnings;

     package Foo;

     use base qw(Wikibase::Cache::Backend);

     sub _get {
             my ($self, $type, $key) = @_;

             my $value = $self-&gt;{'_data'}-&gt;{$type}-&gt;{$key} || undef;

             return $value;
     }

     sub _save {
             my ($self, $type, $key, $value) = @_;

             $self-&gt;{'_data'}-&gt;{$type}-&gt;{$key} = $value;

             return $value;
     }

     package main;

     # Object.
     my $obj = Foo-&gt;new;

     # Save cached value.
     $obj-&gt;save('label', 'foo', 'FOO');

     # Get cached value.
     my $value = $obj-&gt;get('label', 'foo');

     # Print out.
     print $value."\n";

     # Output like:
     # FOO

DEPENDENCIES
    Class::Utils, Error::Pure, List::Util, Readonly.

SEE ALSO
    Wikibase::Cache
        Wikibase cache class.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/Wikibase-Cache-Backend&gt;

AUTHOR
    Michal Josef ﾅ�paﾄ稿k &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    ﾂｩ 2021-2023 Michal Josef ﾅ�paﾄ稿k

    BSD 2-Clause License

VERSION
    0.04

</pre></body></html>