X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FScope.pm;h=e973adc20d6baa6af64b81c16fe6cc0b2b45b9f4;hp=3686beb28b5e7f73d4b5302524f41b8d317b7fb8;hb=e6c6fbca8df4f8df7bbce2eb98dd260ed51d9141;hpb=fcf49f47b7655e0bc3ed8c3da7f1004cbb70c7a5 diff --git a/lib/LaTeX/TikZ/Scope.pm b/lib/LaTeX/TikZ/Scope.pm index 3686beb..e973adc 100644 --- a/lib/LaTeX/TikZ/Scope.pm +++ b/lib/LaTeX/TikZ/Scope.pm @@ -21,6 +21,12 @@ use LaTeX::TikZ::Tools; use Any::Moose; +=head1 ATTRIBUTES + +=head2 C + +=cut + has '_mods' => ( is => 'ro', isa => 'Maybe[ArrayRef[LaTeX::TikZ::Mod::Formatted]]', @@ -37,6 +43,10 @@ has '_mods_cache' => ( default => sub { +{ } }, ); +=head2 C + +=cut + has '_body' => ( is => 'rw', isa => 'LaTeX::TikZ::Scope|ArrayRef[Str]', @@ -48,6 +58,12 @@ my $ltmf_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Mod::Formatted' my $_body_tc = __PACKAGE__->meta->find_attribute_by_name('_body') ->type_constraint; +=head1 METHODS + +=head2 C + +=cut + sub mod { my $scope = shift; @@ -65,6 +81,10 @@ sub mod { $scope; } +=head2 C + +=cut + sub body { my $scope = shift; @@ -80,6 +100,10 @@ use overload ( '@{}' => 'dereference', ); +=head2 C + +=cut + sub flatten { my ($scope) = @_; @@ -114,6 +138,10 @@ my $inter = Sub::Name::subname('inter' => sub { return \@left, \@common, \@right; }); +=head2 C + +=cut + sub instantiate { my ($scope) = @_; @@ -164,8 +192,16 @@ sub instantiate { return @body; } +=head2 C + +=cut + sub dereference { [ $_[0]->instantiate ] } +=head2 C + +=cut + sub fold { my ($left, $right, $rev) = @_;