NAME
Iterator::Flex::Utils - Internal utilities
VERSION
version 0.31
SUBROUTINES
parse_pars
( $mpars, $ipars, $spars ) = parse_params( \%args );
Returns the model interface signal parameters from %args
.
can_meth
$code = can_meth( $obj, @method, ?\%pars );
Scans an object to see if it provides one of the specified methods. For each $method
in @methods
, it probes for __$method__
, then $method
.
By default, it returns a reference to the first method it finds, otherwise undef
if none was found.
The return value can be altered using %pars
.
- name
-
return the name of the method.
- code
-
return the coderef of the method. (Default)
If both code
and name
are specified, both are returned as a list, name
first:
($name, $code ) = can_meth( $obj, @methods, {name => 1, code => 1 } );
resolve_meth
$code = resolve_meth( $target, $method, @fallbacks );
Return a coderef to the specified method or one of the fallbacks.
If $method
is a coderef, it is returned.
If $method
is defined and is not a coderef, it is checked for directly via $target-
can>. If it does not exist, a Iterator::Flex::Failure::parameter
error is thrown.
If $method
is not defined, then can_meth( $target, @fallbacks )
is returned.
load_module
$module = load_module( $module, ?\@namespaces );
Loads the named module. If $module
begins with a +
it is assumed to be a fully qualified module name, otherwise it is searched for in the namespaces provided by @namespaces
(which defaults to the namespaces returned by the _namespaces
class method.
Throws Iterator::Flex::Failure::class
if it couldn't require the module (for whatever reason).
load_role
$module = load_role( $role, @namespaces );
Loads the named role. If $role
begins with a +
, it is assumed to be a fully qualified name, otherwise it is searched for in the @namespaces
INTERNALS
SUPPORT
Bugs
Please report any bugs or feature requests to bug-iterator-flex@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Iterator-Flex
Source
Source is available at
https://gitlab.com/djerius/iterator-flex
and may be cloned from
https://gitlab.com/djerius/iterator-flex.git
SEE ALSO
Please see those modules/websites for more information related to this module.
AUTHOR
Diab Jerius <djerius@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007