<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
This file was generated by Devel::Cover Version 1.26
Devel::Cover is copyright 2001-2012, Paul Johnson (paul@pjcj.net)
Devel::Cover is free. It is licensed under the same terms as Perl itself.
The latest version of Devel::Cover should be available from my homepage:
http://www.pjcj.net
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<meta http-equiv="Content-Language" content="en-us"></meta>
<link rel="stylesheet" type="text/css" href="cover.css"></link>
<link rel="stylesheet" type="text/css" href="cover.css"></link>
<title>File Coverage: lib/Yukki/Web/Plugin/Role/FormatHelper.pm</title>
</head>
<body>
<h1>File Coverage</h1>
<table>
<tr><td class="h" align="right">File:</td><td align="left">lib/Yukki/Web/Plugin/Role/FormatHelper.pm</td></tr>
<tr><td class="h" align="right">Coverage:</td><td align="left" class="c3">100.0%</td></tr>
</table>
<div><br/></div>
<table>
<tr><th>line</th><th>stmt</th><th>bran</th><th>cond</th><th>sub</th><th>pod</th><th>time</th><th>code</th></tr>
<tr><td class="h">1</td><td></td><td></td><td></td><td></td><td></td><td></td><td class="s">package Yukki::Web::Plugin::Role::FormatHelper;</td></tr>
<tr><td class="h">2</td><td colspan="7"></td></tr><tr><td class="h">3</td><td><div class="c3">2</div><div class="c3">2</div></td><td></td><td></td><td><div class="c3"><a href="lib-Yukki-Web-Plugin-Role-FormatHelper-pm--subroutine.html#L3">2</a></div></td><td></td><td><div>754</div><div>6</div></td><td class="s">use v5.24;</td></tr>
<tr><td class="h">4</td><td><div class="c3">2</div><div class="c3">2</div><div class="c3">2</div></td><td></td><td></td><td><div class="c3"><a href="lib-Yukki-Web-Plugin-Role-FormatHelper-pm--subroutine.html#L4">2</a></div></td><td></td><td><div>7</div><div>4</div><div>10</div></td><td class="s">use utf8;</td></tr>
<tr><td class="h">5</td><td><div class="c3">2</div><div class="c3">2</div><div class="c3">2</div></td><td></td><td></td><td><div class="c3"><a href="lib-Yukki-Web-Plugin-Role-FormatHelper-pm--subroutine.html#L5">2</a></div></td><td></td><td><div>28</div><div>5</div><div>12</div></td><td class="s">use Moo::Role;</td></tr>
<tr><td class="h">6</td><td colspan="7"></td></tr><tr><td class="h">7</td><td></td><td></td><td></td><td></td><td></td><td></td><td class="s"># ABSTRACT: interface for quick format helpers</td></tr>
<tr><td class="h">8</td><td colspan="7"></td></tr><tr><td class="h">9 - 74</td><td colspan="6"></td><td class="s"><pre>=head1 SYNOPSIS
package MyPlugins::LowerCase;
use 5.12.1;
use Moo;
use Types::Standard qw( HashRef Str );
extends 'Yukki::Web::Plugin';
has format_helpers => (
is => 'ro',
isa => HashRef[Str],
default => sub { +{
'lc' => 'lc_helper',
} },
);
with 'Yukki::Web::Plugin::Role::FormatHelper';
sub lc_helper {
my ($self, $params) = @_;
return lc $params->{arg};
}
=head1 DESCRIPTION
This role defines the interface for quick yukkitext helpers. Each plugin implementing this role may provide code references for embedding content in yukkitext using a special C<{{...}}> notation.
=head1 REQUIRED METHODS
An implementor must provide the following methods.
=head2 format_helpers
This must return a reference to hash mapping quick helper names to method names that may be called to handle them.
The names may be any text that does not contain a colon (":").
The methods will be called with the following parameters:
=over
=item context
The curent L<Yukki::Web::Context> object.
=item file
This is the L<Yukki::Model::File> being formatted.
=item helper_name
The helper name the user used.
=item arg
The string argument passed to it.
=back
When called the method must return a scalar value to insert into the page. This is generally a string and may include any markup that should be added to the page.
If the method throws and exception or returns C<undef> or something other than a scalar, the yukkitext formatter will include the original C<{{...}}> string as-is.
=cut</pre></td></tr>
<tr><td class="h">75</td><td colspan="7"></td></tr><tr><td class="h">76</td><td></td><td></td><td></td><td></td><td></td><td></td><td class="s">requires qw( format_helpers );</td></tr>
<tr><td class="h">77</td><td colspan="7"></td></tr><tr><td class="h">78</td><td></td><td></td><td></td><td></td><td></td><td></td><td class="s">1;</td></tr>
</table>
</body>
</html>