]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Raw.pm
Remove magic LaTeX::TikZ::Interface->import
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Raw.pm
index 169569f9aab93d9ccaf34eb5c38478ba0a5738e9..46d8da165906ce1c86840677c679941537e3587b 100644 (file)
@@ -15,6 +15,9 @@ Version 0.01
 
 our $VERSION = '0.01';
 
+use LaTeX::TikZ::Interface;
+use LaTeX::TikZ::Functor;
+
 use Any::Moose;
 
 with 'LaTeX::TikZ::Set::Op';
@@ -27,11 +30,20 @@ has 'content' => (
 
 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;