Toby Inkster > MooseX-Prototype-0.001 > MooseX::Prototype::Role::UseAsPrototype

Download:
MooseX-Prototype-0.001.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.001   Source  

NAME ^

MooseX::Prototype::Role::UseAsPrototype - role providing a use_as_prototype method

SYNOPSIS ^

 {
   package Person;
   use Moose;
   with 'MooseX::Prototype::Role::UseAsPrototype';
   has name     => (is => 'rw', isa => 'Str');
   has employer => (is => 'rw', isa => 'Str');
 }
 
 package main;
 
 my $template     = Person->new(employer => 'Government');
 my $CivilServant = $template->use_as_prototype;
 
 my $bob = $CivilServant->new(name => 'Bob');
 say $bob->name;       # Bob
 say $bob->employer;   # Government

DESCRIPTION ^

$object->use_as_prototype

Works as per the function of the same name in MooseX::Prototype, but should be called as a method.

BUGS ^

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=MooseX-Prototype.

SEE ALSO ^

Object::Prototype, MooseX::Prototype.

AUTHOR ^

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE ^

This software is copyright (c) 2012 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES ^

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

syntax highlighting: