MooseX::Types::Moose - Type exports that match the types shipped with L<Moose>


MooseX-Types documentation Contained in the MooseX-Types distribution.

Index


Code Index:

NAME

Top

MooseX::Types::Moose - Type exports that match the types shipped with Moose

VERSION

Top

version 0.27

SYNOPSIS

Top

  package Foo;
  use Moose;
  use MooseX::Types::Moose qw( Int Str );
  use Carp qw( croak );

  has 'name',
    is  => 'rw',
    isa => Str;

  has 'id',
    is  => 'rw',
    isa => Int;

  sub add {
      my ($self, $x, $y) = @_;
      croak 'First arg not an Int'  unless is_Int($x);
      croak 'Second arg not an Int' unless is_Int($y);
      return $x + $y;
  }

  1;

DESCRIPTION

Top

This package contains a virtual library for MooseX::Types that is able to export all types known to Moose. See MooseX::Types for general usage information.

METHODS

Top

type_storage

Overrides MooseX::Types::Base' type_storage to provide a hash reference containing all built-in Moose types.

SEE ALSO

Top

MooseX::Types::Moose, Moose, Moose::Util::TypeConstraints

LICENSE

Top

This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.

AUTHOR

Top

Robert "phaylon" Sedlacek <rs@474.at>

COPYRIGHT AND LICENSE

Top


MooseX-Types documentation Contained in the MooseX-Types distribution.

package MooseX::Types::Moose;
BEGIN {
  $MooseX::Types::Moose::VERSION = '0.27';
}

# ABSTRACT: Type exports that match the types shipped with L<Moose>

use warnings;
use strict;

use MooseX::Types;
use Moose::Util::TypeConstraints ();

use namespace::clean -except => [qw( meta )];


# all available builtin types as short and long name
my %BuiltIn_Storage 
  = map { ($_) x 2 } 
    Moose::Util::TypeConstraints->list_all_builtin_type_constraints;


# use prepopulated builtin hash as type storage
sub type_storage { \%BuiltIn_Storage }


1;

__END__