Fey::Role::HasAliasName - A role for objects that bring an alias with them
package My::Thing; use Moose; with 'Fey::Role::HasAliasName' => { generated_alias_prefix => 'THING' };
This role adds an alias_name attribute to objects, as well as some methods for making use of that alias.
alias_name
The prefix that generated aliases will have, e.g. LITERAL, FUNCTION, etc. Required.
LITERAL
FUNCTION
If true, sql_with_alias() will wrap the output of sql() when generating its own output. Default is false.
sql_with_alias()
sql()
Returns the current alias name, if any.
$obj->set_alias_name('my object');
Sets the current alias name.
Returns the appropriate SQL snippet. sql_with_alias will generate an alias if one has not been set (using generated_alias_prefix, above).
sql_with_alias
generated_alias_prefix
Hans Dieter Pearcey <hdp.cpan.fey@weftsoar.net>
See Fey for details on how to report bugs.
Copyright 2006-2009 Dave Rolsky, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Fey, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fey
CPAN shell
perl -MCPAN -e shell install Fey
For more information on module installation, please visit the detailed CPAN module installation guide.