=head1 NAME
-LaTeX::TikZ::Point - Interface role for what LaTeX::TikZ consider as 2D points.
+LaTeX::TikZ::Point - Internal representation of what LaTeX::TikZ consider as 2D points.
=head1 VERSION
our $VERSION = '0.01';
-use Any::Moose 'Role';
+use Any::Moose;
+use Any::Moose 'Util::TypeConstraints' => [ qw/
+ coerce
+ from
+ via
+ find_type_constraint
+ register_type_constraint
+/ ];
+
+has 'x' => (
+ is => 'ro',
+ isa => 'Num',
+ required => 1,
+);
+
+has 'y' => (
+ is => 'ro',
+ isa => 'Num',
+ required => 1,
+);
-requires qw(
- x
- y
+use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
+
+register_type_constraint(
+ LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
+ name => 'LaTeX::TikZ::Point::Autocoerce',
+ parent => find_type_constraint(__PACKAGE__),
+ ),
);
+coerce 'LaTeX::TikZ::Point::Autocoerce'
+ => from 'LaTeX::TikZ::Point'
+ => via { $_ };
+
+__PACKAGE__->meta->make_immutable;
+
=head1 AUTHOR
Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.