]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Arrow.pm
This is 0.03
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Arrow.pm
index cc10eab2bd35bb85aed5b513a402f758854d1f4c..4ebee4d708fc119b2b7e012b36134e4a84ec0ec3 100644 (file)
@@ -9,45 +9,53 @@ LaTeX::TikZ::Set::Arrow - A combined set object representing an arrow.
 
 =head1 VERSION
 
-Version 0.01
+Version 0.03
 
 =cut
 
-our $VERSION = '0.01';
+our $VERSION = '0.03';
 
-use Carp;
+use Carp ();
 
 use LaTeX::TikZ::Point;
 
 use LaTeX::TikZ::Set::Line;
 
-use Any::Moose 'Util::TypeConstraints' => [ 'find_type_constraint' ];
+use LaTeX::TikZ::Interface;
+
+use Mouse::Util::TypeConstraints 'find_type_constraint';
 
 my $ltp_tc = find_type_constraint('LaTeX::TikZ::Point::Autocoerce');
 
-use LaTeX::TikZ::Interface arrow => sub {
- shift;
+LaTeX::TikZ::Interface->register(
+ arrow => sub {
+  shift;
+
+  Carp::confess('Not enough arguments') unless @_ >= 2;
+
+  my $from = $ltp_tc->coerce(shift);
 
- Carp::confess('Not enough arguments') unless @_ >= 2;
+  my $to;
+  if ($_[0] eq 'dir') {
+   my $dir = $ltp_tc->coerce($_[1]);
+   $to = LaTeX::TikZ::Point->new(
+    x => $from->x + $dir->x,
+    y => $from->y + $dir->y,
+   );
+  } else {
+   $to = $_[0];
+  }
 
- my $from = $ltp_tc->coerce(shift);
+  LaTeX::TikZ::Set::Line->new(
+   from => $from,
+   to   => $to,
+  )->mod('->');
+ },
+);
 
- my $to;
- if ($_[0] eq 'dir') {
-  my $dir = $ltp_tc->coerce($_[1]);
-  $to = LaTeX::TikZ::Point->new(
-   x => $from->x + $dir->x,
-   y => $from->y + $dir->y,
-  );
- } else {
-  $to = $_[0];
- }
+=head1 SEE ALSO
 
- LaTeX::TikZ::Set::Line->new(
-  from => $from,
-  to   => $to,
- )->mod('->');
-};
+L<LaTeX::TikZ>, L<LaTeX::TikZ::Set>.
 
 =head1 AUTHOR
 
@@ -68,7 +76,7 @@ You can find documentation for this module with the perldoc command.
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2010 Vincent Pit, all rights reserved.
+Copyright 2010,2011,2012,2013,2014,2015 Vincent Pit, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.