| MooseX-Lexical-Types documentation | Contained in the MooseX-Lexical-Types distribution. |
MooseX::Lexical::Types::TypeDecorator
version 0.01
Florian Ragwitz <rafl@debian.org>
This software is copyright (c) 2009 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
| MooseX-Lexical-Types documentation | Contained in the MooseX-Lexical-Types distribution. |
package MooseX::Lexical::Types::TypeDecorator; our $VERSION = '0.01'; use Moose; use MooseX::Types::Moose qw/Str/; use namespace::autoclean; use overload '""' => \&type_package; extends 'MooseX::Types::TypeDecorator'; has type_namespace => ( is => 'ro', isa => Str, lazy => 1, default => sub { 'MooseX::Lexical::Types::' }, ); sub type_package { my ($self) = @_; if (blessed $self) { return $self->type_namespace . $self->__type_constraint->name; } else { return "$self"; } } __PACKAGE__->meta->make_immutable(inline_constructor => 0); 1; __END__