Newcomen

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

Index


NAME ^

Newcomen::Role::Attribute::Site - Moose role for easy site access.

SYNOPSIS ^

# In the consuming class:

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

# Then _site() is available:
my $site = $self -> _site ();

DESCRIPTION ^

Newcomen::Role::Attribute::Site adds the _site attribute to the consuming class. This may be used to access the Newcomen::Site instance (as a getter: _site()). 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 site role, see the SYNOPSIS above.

INSTANCE METHODS ^

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

_site

my $site = $self -> _site ();

Returns the Newcomen::Site instance (as provided by Newcomen::Core's site() method).

MISCELLANEOUS ^

This role also defines the method _build_site(), the builder for the _site 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::Site

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/>.