]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Raw.pm
Fix ->content description of raw mods and sets
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Raw.pm
index 169569f9aab93d9ccaf34eb5c38478ba0a5738e9..159492d0f87cddb7378f2f34ad72267abe3d8a5d 100644 (file)
@@ -9,32 +9,68 @@ LaTeX::TikZ::Set::Raw - A literal chunk of TikZ code.
 
 =head1 VERSION
 
-Version 0.01
+Version 0.02
 
 =cut
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
+
+use LaTeX::TikZ::Interface;
+use LaTeX::TikZ::Functor;
 
 use Any::Moose;
 
+=head1 RELATIONSHIPS
+
+This class consumes the L<LaTeX::TikZ::Set::Op> role, and as such implements the L</path> method.
+
+=cut
+
 with 'LaTeX::TikZ::Set::Op';
 
+=head1 ATTRIBUTES
+
+=head2 C<content>
+
+The bare string the raw set is made of.
+
+=cut
+
 has 'content' => (
  is       => 'ro',
  isa      => 'Str',
  required => 1,
 );
 
+=head1 METHODS
+
+=head2 C<path>
+
+=cut
+
 sub path { $_[0]->content }
 
-use LaTeX::TikZ::Interface raw => sub {
- shift;
+LaTeX::TikZ::Interface->register(
+ raw => sub {
+  shift;
 
- __PACKAGE__->new(content => join ' ', @_);
-};
+  __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<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Op>.
+
 =head1 AUTHOR
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.