NAME

Aion::Pleroma - container of aeons

SYNOPSIS

use Aion::Pleroma;

my $pleroma = Aion::Pleroma->new;

$pleroma->get('user') # -> undef
$pleroma->resolve('user') # @-> user is'nt eon!

DESCRIPTION

Implements the dependency container pattern.

An eon is created when requesting from a container via the get or resolve method, or via the eon aspect as a lazy default. Laziness can be canceled via the lazy aspect.

The container is in the $Aion::pleroma variable and can be replaced with local.

The configuration for creating eons is obtained from the PLEROMA config and the annotation file (created by the Aion::Annotation package). The annotation file can be replaced via the INI config.

FEATURES

ini

Annotation file.

Aion::Pleroma->new->ini # => etc/annotation/eon.ann

pleroma

Configuration: key => 'class#class_method'.

File lib/Ex/Eon/AnimalEon.pm:

package Ex::Eon::AnimalEon;
#@eon

use common::sense;

use Aion;
 
has role => (is => 'ro');

#@eon ex.cat
sub cat { __PACKAGE__->new(role => 'cat') }

#@eon
sub dog { __PACKAGE__->new(role => 'dog') }

1;

File etc/annotation/eon.ann:

Ex::Eon::AnimalEon#,2=
Ex::Eon::AnimalEon#cat,10=ex.cat
Ex::Eon::AnimalEon#dog,13=Ex::Eon::AnimalEon#dog



Aion::Pleroma->new->pleroma # --> {"Ex::Eon::AnimalEon" => "Ex::Eon::AnimalEon#new", "Ex::Eon::AnimalEon#dog" => "Ex::Eon::AnimalEon#dog", "ex.cat" => "Ex::Eon::AnimalEon#cat"}

eon

The totality of generated eons.

my $pleroma = Aion::Pleroma->new;

$pleroma->eon # --> {}
my $cat = $pleroma->resolve('ex.cat');
$pleroma->eon # --> { "ex.cat" => $cat }

SUBROUTINES

get ($key)

Receive an eon from the container.

my $pleroma = Aion::Pleroma->new;
$pleroma->get('') # -> undef
$pleroma->get('Ex::Eon::AnimalEon#dog')->role # => dog

resolve ($key)

Get an eon from the container or an exception if it is not there.

my $pleroma = Aion::Pleroma->new;
$pleroma->resolve('e.ibex') # @=> e.ibex is'nt eon!
$pleroma->resolve('Ex::Eon::AnimalEon#dog')->role # => dog

AUTHOR

Yaroslav O. Kosmina mailto:dart@cpan.org

LICENSE

GPLv3

COPYRIGHT

The Aion::Pleroma module is copyright © 2025 Yaroslav O. Kosmina. Rusland. All rights reserved.