Newcomen

Description A static content generator.
Newcomen > Perl Modules > Newcomen::Role::Attribute::URL
Source

Index


NAME ^

Newcomen::Role::Attribute::URL - Moose role for easy access to the URL map.

SYNOPSIS ^

# In the consuming class:

with 'Newcomen::Role::Attribute::Core';
with 'Newcomen::Role::Attribute::URL';

# Then _url() is available:
my $url = $self -> _url ();

DESCRIPTION ^

Newcomen::Role::Attribute::URL adds the _url attribute to the consuming class. This may be used to access the Newcomen::URL instance (as a getter: _url()). It may be used by any class that requires access to it.

Note that this role requires a _core() method to be available, which must return the global core (Newcomen::Core) instance. Consuming the role Newcomen::Role::Attribute::Core is the easiest way to satisfy this requirement. This has to be done before consuming the URL role, see the SYNOPSIS above.

INSTANCE METHODS ^

Note that these methods are available in the consuming class, Newcomen::Role::Attribute::URL is just a Moose role.

_url

my $url = $self -> _url ();

Returns the Newcomen::URL instance (as provided by Newcomen::Core's url() method).

MISCELLANEOUS ^

This role also defines the method _build_url(), the builder for the _url attribute. Do not use this name for anything in the consuming class. The builder is lazy, i.e. the attribute will be initialized on first access. The attribute will be read only, and it may not be set using the constructor.

SEE ALSO ^

Moose, Newcomen::Core, Newcomen::Role::Attribute::Core, Newcomen::URL

VERSION ^

This is version 2014052501.

AUTHOR ^

Stefan Goebel - newcomen {at} subtype {dot} de

COPYRIGHT AND LICENSE ^

Copyright 2013-2014 Stefan Goebel.

This file is part of Newcomen.

Newcomen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license, or (at your option) any later version.

Newcomen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Newcomen. If not, see <http://www.gnu.org/licenses/>.