NAME

Constructor::SugarLibrary - build a library of generic constructor syntax sugar

VERSION

version 1.152070

SYNOPSIS

# set up the library package
package My::SugarLib;
use Constructor::SugarLibrary;

sweeten "My::Moo::Object";
sweeten "My::Moose::Thing";

And now these do the same:

package My::NormalCode;
use My::Moo::Object;
use My::Moose::Thing;

my $obj = My::Moo::Object->new( plus => "some", more => "data" );
die if !$obj->isa( "My::Moo::Object" );
my $obj2 = My::Moose::Thing->new( with => "other", meta => "data" );
die if !$obj->isa( "My::Moose::Thing" );

package My::SugaredCode;
use My::SugarLib;

my $obj = object plus => "some", more => "data";
die if $obj->isa( Object );
my $obj2 = thing with => "other", meta => "data";
die if $obj->isa( Thing );

AUTHOR

Christian Walde <walde.christian@gmail.com>

COPYRIGHT AND LICENSE

Christian Walde has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law.

Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author.