NAME
Froody::Repository - a repository of Froody::Method objects.
SYNOPSIS
use Froody::Repository;
my $repository = Froody::Repository->new();
# methods for putting stuff in the repository
$repository->register_implementation('Implementation::Package');
$repository->register_method($froody_method);
$repository->register_errortype($froody_errortype);
# methods for getting froody methods out
my $method = $repository->get_method('name.of.method');
my @methods = $repository->get_methods;
my @methods2 = $repository->get_methods('namespace.of.interest');
my @methods3 = $repository->get_methods(qr/delete/);
# methods for getting froody errortype out
my $errortype = $repository->get_errortype('name.of.errortype');
my @errortype = $repository->get_errortypes;
my @errortype2 = $repository->get_errortypes('errortypes.of.interest');
my @errortype3 = $repository->get_errortypes(qr/delete/);
my $errortype2 = $repository->get_closest_errortype('fragment.of.type');
DESCRIPTION
Froody::Repository provides a central location to register and discover Froody::Method instances.
METHODS
Methods for dealing with Froody::Method instances
- register_method( Froody::Method )
-
Register a method with the repository. You don't ever normally have to call this method yourself, things like your Froody::Implementation subclasses do it themselves from
register_in_repository
. - get_methods() || get_methods( $regex ) || get_methods( "foo.bar.*" )
-
Return all methods (as Froody::Method objects) if invoked with no arguments, or only the methods matching the query if invoked with an argument.
- get_method($name)
-
Return a single method (as a Froody::Method object) matching $name exactly. Throws a Froody::Error of type "froody.invoke.nosuchmethod" if no method matching the $name is registered with this repository.
Methods for dealing with Froody::ErrorType instances
- register_errortype( Froody::ErrorType )
-
Register an errortype with the repository. You don't ever normally have to call this method yourself, things like your Froody::Implementation subclasses do it themselves from
register_in_repository
. - get_errortype($name)
-
Return a single errortype (as a Froody::ErrorType object) matching $name exactly. Throws a Froody::Error of type "froody.invoke.nosucherrortype" if no method matching the $name is registered with this repository.
- get_errortypes() || get_errortypes( $regex ) || get_errortypes( "foo.bar.*" )
-
Return all errortypes (as Froody::ErrorTypes objects) if invoked with no arguments, or only the methods matching the query if invoked with an argument.
- get_closest_errortype
- register_implementation(PACKAGE NAME)
-
Registers all the methods associated with a given implementation and API in this repository.
- register_api($api, $invoker, @method_matches)
-
Registers all the methods associated with a given API.
- load($invoker, [structures], [method filters])
-
Loads a set of method and errortype structures into the repository
BUGS
None known
We're using match_to_regex
from Froody::Method, maybe that should be refactored elsewhere
Please report any bugs you find via the CPAN RT system. http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Froody
AUTHOR
Copyright Fotango 2005. All rights reserved.
Please see the main Froody documentation for details of who has worked on this project.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.