Tree::Visualize::ASCII::BoundingBox - A bounding box for ASCII drawings
use Tree::Visualize::ASCII::BoundingBox; my $box = Tree::Visualize::ASCII::BoundingBox->new(join "\n" => ( '+------+', '| test |', '+------+' )); my $box2 = Tree::Visualize::ASCII::BoundingBox->new(join "\n" => ( '+-------+', '| test2 |', '+-------+' )); my $box3 = $box->padRight(" ")->pasteRight($box2); print $box3->getAsString(); # will give you: # +------+ +-------+ # | test | | test2 | # +------+ +-------+
Returns the height of the bounding box.
Returns the width of the bounding box.
Returns an array of string representing each line of the drawing.
Returns the completed drawing as a single string.
NOTE: This method is used for particular purpose and will likely be changed.
Given a $padding of spaces, this will add it to the left side of the bounding box.
$padding
Given a $padding of spaces, this will add it to the right side of the bounding box.
Given another BoundingBox object ($right) this will paste it onto the left of the current bounding box.
$right
Given another BoundingBox object ($left) this will paste it onto the right of the current bounding box.
$left
Given another BoundingBox object ($top) this will paste it onto the top of the current bounding box.
$top
Given another BoundingBox object ($bottom) this will paste it onto the bottom of the current bounding box.
$bottom
This will flip the bounding box horizontally.
This will flip the bounding box vertically.
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.
I use Devel::Cover to test the code coverage of my tests, below is the Devel::Cover report on this module test suite.
stevan little, <stevan@iinteractive.com>
Copyright 2004 by Infinity Interactive, Inc.
http://www.iinteractive.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Tree::Visualize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tree::Visualize
CPAN shell
perl -MCPAN -e shell install Tree::Visualize
For more information on module installation, please visit the detailed CPAN module installation guide.