The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SHARYANTO::Role::BorderStyle - Role for class wanting to support border styles

VERSION

version 0.67

DESCRIPTION

This role is for class that wants to support border styles. For description about border styles, currently please refer to Text::ANSITable.

Border style is a hash containing name, summary, utf8 (bool, set to true to indicate that characters are Unicode characters in UTF8), chars (array). Format for the characters in chars:

 [
   [A, b, C, D],  # 0
   [E, F, G],     # 1
   [H, i, J, K],  # 2
   [L, M, N],     # 3
   [O, p, Q, R],  # 4
   [S, t, U, V],  # 5
 ]

 AbbbCbbbD        #0 Top border characters
 E   F   G        #1 Vertical separators for header row
 HiiiJiiiK        #2 Separator between header row and first data row
 L   M   N        #3 Vertical separators for data row
 OpppQpppR        #4 Separator between data rows
 L   M   N        #3
 StttUtttV        #5 Bottom border characters

For Text::ANSITable: each character must have visual width of 1. But if A is an empty string, the top border line will not be drawn. Likewise: if H is an empty string, the header-data separator line will not be drawn; if S is an empty string, bottom border line will not be drawn.

A character can also be a coderef that will be called with ($self, %args). Arguments in %args contains information such as name, y, x, n (how many times should character be repeated), etc.

ATTRIBUTES

border_style => HASH

border_style_args => HASH

METHODS

$cl->list_border_styles($detail) => ARRAY

$cl->get_border_style($name) => HASH

$cl->get_border_char($y, $x, $repeat, \%args) => STR

Pick border character from border style (and optionally repeat it $repeat times). \%args is a hashref to be supplied to the coderef if the 'chars' value from the style is a coderef.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/SHARYANTO-Roles.

SOURCE

Source repository is at https://github.com/sharyanto/perl-SHARYANTO-Roles.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=SHARYANTO-Roles

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.