KiokuDB::TypeMap::Entry::Std::Compile - Provides a compile implementation


KiokuDB documentation Contained in the KiokuDB distribution.

Index


Code Index:

NAME

Top

KiokuDB::TypeMap::Entry::Std::Compile - Provides a compile implementation

SYNOPSIS

Top

TODO

DESCRIPTION

Top

This role provides an implementation for compile in KiokuDB::TypeMap::Entry by breaking down its requirements into four separated methods.

REQUIRED METHODS

Top

compile_collapse

Must return a code reference or method name. The calling conventions for this method are described in collapse_method in KiokuDB::TypeMap::Entry::Compiled.

compile_expand

Must return a code reference or method name. The calling conventions for this method are described in expand_method in KiokuDB::TypeMap::Entry::Compiled.

compile_id

Must return a code reference or method name. The calling conventions for this method are described in id_method in KiokuDB::TypeMap::Entry::Compiled.

compile_refresh

Must return a code reference or method name. The calling conventions for this method are described in refresh_method in KiokuDB::TypeMap::Entry::Compiled.

SEE ALSO

Top

KiokuDB::TypeMap::Entry::Compiled


KiokuDB documentation Contained in the KiokuDB distribution.

package KiokuDB::TypeMap::Entry::Std::Compile;
use Moose::Role;

use KiokuDB::TypeMap::Entry::Compiled;

use namespace::clean -except => 'meta';

requires qw(
    compile_collapse
    compile_expand
    compile_id
    compile_refresh
);

sub compile {
    my ( $self, $class, @args ) = @_;

    $self->new_compiled(
        collapse_method => $self->compile_collapse($class, @args),
        expand_method   => $self->compile_expand($class, @args),
        id_method       => $self->compile_id($class, @args),
        refresh_method  => $self->compile_refresh($class, @args),
        class           => $class,
    );
}

sub new_compiled {
    my ( $self, @args ) = @_;

    KiokuDB::TypeMap::Entry::Compiled->new(
        entry           => $self,
        @args,
    );
}

__PACKAGE__

__END__