Articulate::Construction::LocationBased - Create an item based on its location
This should be a hashref mapping types to class names to be used in constructors, where a type in this case is the penultimate endpoint of locations with an even number of parts
So:
article: Articulate::Item::Article
...would result in /article/foo or zone/public/article/foo becoming Articulate::Item::Articles but not article, zone/article, or zone/public/article.
/article/foo
zone/public/article/foo
Articulate::Item::Article
article
zone/article
zone/public/article
$self->construct( { location => 'zone/public/article/hello-world', meta => { ... } content => " ... " } );
Attempts to construct the item. Determines the desired class based on the mapping in the types attribute, then calls $class->new($args) on the class. Returns undef if no appropriate class found.
types
$class->new($args)
undef
In the above example, $self->types->{article} would be consulted.
$self->types->{article}
If the location is root or not a multiple of 2 (e.g. zone/public is even and a zone but zone/public/article is odd), returns undef.
zone/public
zone
To install Articulate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Articulate
CPAN shell
perl -MCPAN -e shell install Articulate
For more information on module installation, please visit the detailed CPAN module installation guide.