[libtype-tiny-perl] 34/46: steer away from Type::Utils in documentation
Jonas Smedegaard
dr at jones.dk
Fri Sep 12 18:48:04 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 1.001_000
in repository libtype-tiny-perl.
commit 114395772e556f311c5252ff479d43c3ad71083c
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date: Sun Sep 7 15:12:49 2014 +0100
steer away from Type::Utils in documentation
---
lib/Type/Tiny/Manual/UsingWithMoose.pod | 12 +++++-------
lib/Type/Tiny/Manual/UsingWithMouse.pod | 12 +++++-------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/lib/Type/Tiny/Manual/UsingWithMoose.pod b/lib/Type/Tiny/Manual/UsingWithMoose.pod
index b1d443e..9d25ffb 100644
--- a/lib/Type/Tiny/Manual/UsingWithMoose.pod
+++ b/lib/Type/Tiny/Manual/UsingWithMoose.pod
@@ -13,19 +13,15 @@ Type::Tiny::Manual::UsingWithMoose - how to use Type::Tiny and Type::Library wit
use Moose;
use Types::Standard qw( Str Int );
- use Type::Utils qw( declare as where inline_as coerce from );
has name => (
is => "ro",
isa => Str,
);
- my $PositiveInt = declare
- as Int,
- where { $_ > 0 },
- inline_as { "$_ =~ /^[0-9]+\$/ and $_ > 0" };
-
- coerce $PositiveInt, from Int, q{ abs $_ };
+ my $PositiveInt = Int
+ -> where( sub { $_ > 0 } )
+ -> plus_coercions( Int, sub { abs $_ } );
has age => (
is => "ro",
@@ -44,6 +40,8 @@ Type::Tiny::Manual::UsingWithMoose - how to use Type::Tiny and Type::Library wit
=head1 DESCRIPTION
+Type::Tiny is tested with L<Moose> 2.0007 and above.
+
L<Type::Tiny> type constraints have an API almost identical to that of
L<Moose::Meta::TypeConstraint>. It is also able to build a
Moose::Meta::TypeConstraint constraint from a Type::Tiny constraint, and
diff --git a/lib/Type/Tiny/Manual/UsingWithMouse.pod b/lib/Type/Tiny/Manual/UsingWithMouse.pod
index 7632fc1..603a8d5 100644
--- a/lib/Type/Tiny/Manual/UsingWithMouse.pod
+++ b/lib/Type/Tiny/Manual/UsingWithMouse.pod
@@ -13,19 +13,15 @@ Type::Tiny::Manual::UsingWithMouse - how to use Type::Tiny and Type::Library wit
use Mouse;
use Types::Standard qw( Str Int );
- use Type::Utils qw( declare as where inline_as coerce from );
has name => (
is => "ro",
isa => Str,
);
- my $PositiveInt = declare
- as Int,
- where { $_ > 0 },
- inline_as { "$_ =~ /^[0-9]+\$/ and $_ > 0" };
-
- coerce $PositiveInt, from Int, q{ abs $_ };
+ my $PositiveInt = Int
+ -> where( sub { $_ > 0 } )
+ -> plus_coercions( Int, sub { abs $_ } );
has age => (
is => "ro",
@@ -50,6 +46,8 @@ support.
=head1 DESCRIPTION
+Type::Tiny is tested with L<Mouse> 1.00 and above.
+
L<Type::Tiny> type constraints have an API almost identical to that of
L<Mouse::Meta::TypeConstraint>. As a result, you can use a Type::Tiny
object pretty much anywhere you'd use a Mouse::Meta::TypeConstraint and
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtype-tiny-perl.git
More information about the Pkg-perl-cvs-commits
mailing list