The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<!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

&nbsp;&nbsp;package MyPlugins::LowerCase;
&nbsp;&nbsp;use 5.12.1;
&nbsp;&nbsp;use Moo;

&nbsp;&nbsp;use Types::Standard qw( HashRef Str );

&nbsp;&nbsp;extends &#39;Yukki::Web::Plugin&#39;;

&nbsp;&nbsp;has format_helpers =&gt; (
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&gt; &#39;ro&#39;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&gt; HashRef[Str],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&gt; sub { +{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;lc&#39; =&gt; &#39;lc_helper&#39;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} },
&nbsp;&nbsp;);

&nbsp;&nbsp;with &#39;Yukki::Web::Plugin::Role::FormatHelper&#39;;

&nbsp;&nbsp;sub lc_helper {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my ($self, $params) = @_;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return lc $params-&gt;{arg};
&nbsp;&nbsp;}

=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&lt;{{...}}&gt; 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 (&quot;:&quot;).

The methods will be called with the following parameters:

=over

=item context

The curent L&lt;Yukki::Web::Context&gt; object.

=item file

This is the L&lt;Yukki::Model::File&gt; 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&lt;undef&gt; or something other than a scalar, the yukkitext formatter will include the original C&lt;{{...}}&gt; 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>