Class-Visitor

 view release on metacpan or  search on metacpan

Visitor.pm  view on Meta::CPAN

C<as_string> returns the concatenated scalar values of the array field
named C<contents>, possibly modified by C<$context>.
C<I<ARRAYMEMBER>_as_string> does the same for I<ARRAYMEMBER>.

Visitor handles scalars specially for C<children_accept> and
C<as_string>.  In the case of C<children_accept>, Visitor will create
an iterator in the class C<Class::Scalar::Iter> with the scalar as the
delegate.

In the case of C<as_string>, Visitor will use the string unless
C<$context-E<gt>{cdata_mapper}> is defined, in which case it returns
the result of calling the C<cdata_mapper> subroutine with the scalar
and the remaining arguments.  The actual implementation is:

    &{$context->{cdata_mapper}} ($scalar, @_);

=head1 AUTHOR

Ken MacLeod, ken@bitsko.slc.ut.us

=head1 SEE ALSO

perl(1), Class::Template(3), Class::Iter(3).

The package C<SGML::SPGrove> uses C<Class::Visitor> extensively.



( run in 0.263 second using v1.01-cache-2.11-cpan-454fe037f31 )