NAME Tags::HTML::Stars - Tags helper for stars evaluation. SYNOPSIS use Tags::HTML::Stars; my $obj = Tags::HTML::Stars->new(%params); $obj->process($stars_hr); METHODS "new" my $obj = Tags::HTML::Stars->new(%params); Constructor. * "public_image_dir" Public image directory. Default value is undef. * "star_width" Width of star. Default value is undef (original with of image, in case of inline image is 300px). * "tags" 'Tags::Output' object. Default value is undef. "process" $obj->process($stars_hr); Process Tags structure for output with stars. Returns undef. ERRORS new(): From Class::Utils::set_params(): Unknown parameter '%s'. EXAMPLE1 use strict; use warnings; use Tags::HTML::Stars; use Tags::Output::Indent; # Object. my $tags = Tags::Output::Indent->new; my $obj = Tags::HTML::Stars->new( 'tags' => $tags, ); # Process stars. $obj->process({ 1 => 'full', 2 => 'half', 3 => 'nothing', }); # Print out. print $tags->flush; # Output: #
# # #
EXAMPLE2 use strict; use warnings; use Number::Stars; use Tags::HTML::Stars; use Tags::Output::Indent; if (@ARGV < 1) { print STDERR "Usage: $0 percent\n"; exit 1; } my $percent = $ARGV[0]; # Object. my $tags = Tags::Output::Indent->new; my $obj = Tags::HTML::Stars->new( 'tags' => $tags, ); my $stars_hr = Number::Stars->new->percent_stars($percent); # Process stars. $obj->process($stars_hr); # Print out. print $tags->flush; # Output: #
# # # # # # # # #
DEPENDENCIES Class::Utils, Error::Pure, List::Utils, MIME::Base64, Readonly. SEE ALSO Number::Stars Class for conversion between percent number to star visualization REPOSITORY AUTHOR Michal Josef Špaček LICENSE AND COPYRIGHT © Michal Josef Špaček 2020 BSD 2-Clause License VERSION 0.02