X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FSet%2FRaw.pm;h=d49fb3d445766760d0d2081e8f87e7c9c5383503;hb=4f696c03a66ef6b52ee7b9b3c74a71d5abc64f7e;hp=169569f9aab93d9ccaf34eb5c38478ba0a5738e9;hpb=5adf00c880491bac3bd793a07431cf161c03643f;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Set/Raw.pm b/lib/LaTeX/TikZ/Set/Raw.pm index 169569f..d49fb3d 100644 --- a/lib/LaTeX/TikZ/Set/Raw.pm +++ b/lib/LaTeX/TikZ/Set/Raw.pm @@ -9,15 +9,32 @@ LaTeX::TikZ::Set::Raw - A literal chunk of TikZ code. =head1 VERSION -Version 0.01 +Version 0.03 =cut -our $VERSION = '0.01'; +our $VERSION = '0.03'; -use Any::Moose; +use LaTeX::TikZ::Interface; +use LaTeX::TikZ::Functor; -with 'LaTeX::TikZ::Set::Op'; +use Mouse; + +=head1 RELATIONSHIPS + +This class consumes the L role, and as such implements the L method. + +=cut + +with 'LaTeX::TikZ::Set::Path'; + +=head1 ATTRIBUTES + +=head2 C + +The bare string the raw set is made of. + +=cut has 'content' => ( is => 'ro', @@ -25,16 +42,47 @@ has 'content' => ( required => 1, ); +=head1 METHODS + +=head2 C + +=cut + sub path { $_[0]->content } -use LaTeX::TikZ::Interface raw => sub { - shift; +=head2 C - __PACKAGE__->new(content => join ' ', @_); -}; +=cut + +sub begin { undef } + +=head2 C + +=cut + +sub end { undef } + +LaTeX::TikZ::Interface->register( + raw => sub { + shift; + + __PACKAGE__->new(content => join ' ', @_); + }, +); + +LaTeX::TikZ::Functor->default_rule( + (__PACKAGE__) => sub { + my ($functor, $set, @args) = @_; + $set->new(content => $set->content); + } +); __PACKAGE__->meta->make_immutable; +=head1 SEE ALSO + +L, L. + =head1 AUTHOR Vincent Pit, C<< >>, L. @@ -54,7 +102,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.