Description | A static content generator. |
Newcomen::Role::Attribute::Writer - Moose role for easy writer access.
# In the consuming class: with 'Newcomen::Role::Attribute::Core'; with 'Newcomen::Role::Attribute::Writer'; # Then _writer() is available: my $writer = $self -> _writer ();
Newcomen::Role::Attribute::Writer adds the _writer attribute to the consuming class. This may be used to access the Newcomen::Writer instance (as a getter: _writer()). 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 writer role, see the SYNOPSIS above.
Note that these methods are available in the consuming class, Newcomen::Role::Attribute::Writer is just a Moose role.
my $writer = $self -> _writer ();
Returns the Newcomen::Writer instance (as provided by Newcomen::Core's writer() method).
This role also defines the method _build_writer(), the builder for the _writer 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.
Moose, Newcomen::Core, Newcomen::Role::Attribute::Core, Newcomen::Writer
This is version 2014052501
.
Stefan Goebel - newcomen {at} subtype {dot} de
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/>.