NAME
Astro::App::Satpass2::Macro::Code - Implement code as macros
SYNOPSIS
No user-serviceable parts inside.
DESCRIPTION
This class is private to the Astro-App-Satpass2
distribution, mostly because the code interface has not been written.
METHODS
This class provides or overrides the following methods:
execute
$macro->execute( $name, @argv );
This method executes the named code, which must be findable via $macro->implements( $name )
. The code will be passed the parent Astro::App::Satpass2
object as its first argument, and @argv
as subsequent arguments. Whatever it returns will be returned to the caller.
has_lib
This method returns true if the lib
attribute was specified when the class was created.
init
This method treats the name
attribute as the name of a module to be loaded (either with or without 'Astro::App::Satpass2::Macro::Code::'
prepended). This module must be a subclass of Astro::App::Satpass2
. The loaded module's symbol table is examined, and the implements
attribute is populated with names of and references to any code that has the Verb
attribute.
Note that this means the implements( $name )
method returns a reference to the implementing code if $name
is actually implemented; but users of this module should not rely on this behavior.
ATTRIBUTES
This class redefines or adds the following attributes of its superclass:
- lib
-
This is the name of a directory to be added to
@INC
before loading the Perl module that contains the macros. Tilde expansion will be done on the value. The default is lib/ in the user's configuration directory. If the value isundef
, nothing is added to@INC
before the load.The value of this attribute can be retrieved by the same-named method, but since this returns
undef
if this attribute was unspecified as well as if it was explicitly specified asundef
, you should use thehas_lib()
method if the difference is important to your code. - name
-
This is the name of the Perl module containing the desired code macros.
- relative
-
If this attribute is true, the value of the
-lib
option, if any, is left untouched. Otherwise, it is made into an absolute file reference unless it begins with a tilde.This is really only here to make testing easier.
SEE ALSO
The superclass, Astro::App::Satpass2::Macro.
SUPPORT
Support is by the author. Please file bug reports at https://rt.cpan.org/Public/Dist/Display.html?Name=Astro-App-Satpass2, https://github.com/trwyant/perl-Astro-App-Satpass2/issues, or in electronic mail to the author.
AUTHOR
Thomas R. Wyant, III wyant at cpan dot org
COPYRIGHT AND LICENSE
Copyright (C) 2013-2023 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.