summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process/Kernel.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-03-22 06:12:38 +0000
committerfukachan <fukachan>2001-03-22 06:12:38 +0000
commit284f98da1d7230d860fdfbca7c5fa3798e9b7c4d (patch)
tree75f470c84c86baf4e266719abe3a2c1698d503e4 /fml/lib/FML/Process/Kernel.pm
parenta2900623b8baab8734a30de32372b62c4f7683dd (diff)
downloadfml8-284f98da1d7230d860fdfbca7c5fa3798e9b7c4d.tar.gz
fml8-284f98da1d7230d860fdfbca7c5fa3798e9b7c4d.tar.bz2
fml8-284f98da1d7230d860fdfbca7c5fa3798e9b7c4d.zip
define load_module($args, $module) method.
load model dependent module. return the object for $module.
Diffstat (limited to 'fml/lib/FML/Process/Kernel.pm')
-rw-r--r--fml/lib/FML/Process/Kernel.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm
index ba478a83..6db5a939 100644
--- a/fml/lib/FML/Process/Kernel.pm
+++ b/fml/lib/FML/Process/Kernel.pm
@@ -417,6 +417,30 @@ sub parse_incoming_message
}
+=head1 MISCELLANEOUS METHODS
+
+=head2 C<load_module($args, $module)>
+
+load model dependent module.
+return the object for C<$module>.
+
+=cut
+
+sub load_module
+{
+ my ($curproc, $args, $pkg) = @_;
+
+ # fake use() to do "use FML::Ticket::$model;"
+ eval qq{ require $pkg; $pkg->import();};
+ unless ($@) {
+ return $pkg->new($curproc, $args);
+ }
+ else {
+ Log($@);
+ }
+}
+
+
=head1 AUTHOR
Ken'ichi Fukamachi