X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FMeta%2FTypeConstraint%2FAutocoerce.pm;fp=lib%2FLaTeX%2FTikZ%2FMeta%2FTypeConstraint%2FAutocoerce.pm;h=28ca7067a1135f308f18d6234eb49bea2a0d7a92;hp=b1d85079376c935b12593aedda98822c1dd88e9b;hb=61a93a58351bf2d238dcf81a1a557112b0c0ee85;hpb=062ab95259610ce39ace60365b659d6113420ce7 diff --git a/lib/LaTeX/TikZ/Meta/TypeConstraint/Autocoerce.pm b/lib/LaTeX/TikZ/Meta/TypeConstraint/Autocoerce.pm index b1d8507..28ca706 100644 --- a/lib/LaTeX/TikZ/Meta/TypeConstraint/Autocoerce.pm +++ b/lib/LaTeX/TikZ/Meta/TypeConstraint/Autocoerce.pm @@ -142,7 +142,13 @@ my $target_tc = __PACKAGE__->meta->find_attribute_by_name('target') =head1 METHODS -=head2 C<< new name => $name, mapper => $mapper, target => $target >> +=head2 C + + my $tc = LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new( + name => $name, + mapper => $mapper, + target => $target, + ); Constructs a type constraint object that will attempt to autocoerce objects that are not valid according to C<$target> by loading the class returned by C<$mapper>. @@ -178,7 +184,9 @@ around 'new' => sub { return $class->$orig(%args); }; -=head2 C +=head2 C + + $tc->coerce($thing) Tries to coerce C<$thing> by first loading a class that might contain a type coercion for it.