NAME
Class::NiceApi - translates your methodNames to my method_names
SYNOPSIS
use Class::NiceApi;
my $acl = Class::NiceApi->new( victim => Decision::ACL->new(), style => 'custom', table => { run_acl => 'RunACL' } );
DESCRIPTION
Perl method names should be written lowercased and multiple words should be connected via '_'. This is_good_coding_convention
. Unfortunately this recommendation
is ignored by many CPAN authors. Class::NiceApi helps pernickety programmers as me. It translates method names from isThisPerl
to is_this_perl
back and forth. Well, it so flexible it can translate allmost anything to anything. So it would translate perl_method_name
to java programmers favorite perlMethodName
.
METHODS
new()
Takes following parameters (which are also available as methods).
- victim
-
An instance of a class where the method names subjected to translation.
- style
-
A style is just a shortcut for the translation table. Following styles are currently supported:
custom
,with_underscore
andto_lc
.[Note] They are implemented via a 'translating' callback in
$Class::NiceApi::callbacks
. It filters the source method name and returns the destination name. - table
-
Here you can list explicit translations of method names, which are exceptions to the
custom
style filter.
NOTE
new
returns an instance of Class::NiceApi
and not the victim class. But it is a proxy class which quite well mimics its victim (see Class::Proxy and note the hiding limits).
EXPORT
None by default.
AUTHOR
Murat Uenalan, <muenalan@cpan.org>