diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2007-11-10 17:53:53 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2007-11-10 17:53:53 +0000 |
| commit | cfdd733c17cfa4f1a43b827a656e9e53cc2524ac (patch) | |
| tree | b6f659b1281f77628b36768f0888f67b65f9ca48 /lib/Class/MakeMethods/Evaled.pm | |
| parent | 9c6c30350161efd74faa3c3705096aecb71c0e81 (diff) | |
| download | xxv-cfdd733c17cfa4f1a43b827a656e9e53cc2524ac.tar.gz xxv-cfdd733c17cfa4f1a43b827a656e9e53cc2524ac.tar.bz2 | |
* Remove unsed packages
* Reorder exit routines
Diffstat (limited to 'lib/Class/MakeMethods/Evaled.pm')
| -rw-r--r-- | lib/Class/MakeMethods/Evaled.pm | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/lib/Class/MakeMethods/Evaled.pm b/lib/Class/MakeMethods/Evaled.pm deleted file mode 100644 index 233c9c6..0000000 --- a/lib/Class/MakeMethods/Evaled.pm +++ /dev/null @@ -1,97 +0,0 @@ -=head1 NAME - -Class::MakeMethods::Evaled - Make methods with simple string evals - - -=head1 SYNOPSIS - - package MyObject; - use Class::MakeMethods::Evaled::Hash ( - new => 'new', - scalar => [ 'foo', 'bar' ], - array => 'my_list', - hash => 'my_index', - ); - - -=head1 DESCRIPTION - -This document describes the various subclasses of Class::MakeMethods -included under the Evaled::* namespace, and the method types each -one provides. - -The Evaled subclasses generate methods using a simple string templating mechanism and basic string evals. - - -=head2 Calling Conventions - -When you C<use> this package, the method names you provide -as arguments cause subroutines to be generated and installed in -your module. - -See L<Class::MakeMethods::Standard/"Calling Conventions"> for more information. - -=head2 Declaration Syntax - -To declare methods, pass in pairs of a method-type name followed -by one or more method names. - -Valid method-type names for this package are listed in L<"METHOD -GENERATOR TYPES">. - -See L<Class::MakeMethods::Standard/"Declaration Syntax"> and L<Class::MakeMethods::Standard/"Parameter Syntax"> for more information. - -=cut - -package Class::MakeMethods::Evaled; - -$VERSION = 1.000; -use strict; -use Carp; - -use Class::MakeMethods::Standard '-isasubclass'; -use Class::MakeMethods::Utility::TextBuilder 'text_builder'; - -######################################################################## - -=head2 About Evaled Methods - - -=cut - -sub evaled_methods { - my $class = shift; - my $template = shift; - my $package = $Class::MakeMethods::CONTEXT{TargetClass}; - my @declarations = $class->_get_declarations( @_ ); - my @code_chunks; - foreach my $method ( @declarations ) { - my $code = $template; - $code =~ s/__(\w+?)__/$method->{lc $1}/eg; - - # my $code = text_builder( $template, { - # '__NAME__' => $method->{name}, - # '__METHOD__{}' => $method, - # '__CONTEXT__{}' => $Class::MakeMethods::CONTEXT, - # } ); - - push @code_chunks, $code; - } - my $code = join( "\n", "package $package;", @code_chunks, "1;" ); - eval $code; - $@ and Class::MakeMethods::_diagnostic('inst_eval_syntax', 'from eval', $@, $code); - return; -} - -######################################################################## - -=head1 SEE ALSO - -See L<Class::MakeMethods> for general information about this distribution. - -For distribution, installation, support, copyright and license -information, see L<Class::MakeMethods::Docs::ReadMe>. - -=cut - -1; |
