File: DefineKeywords.pm

package info (click to toggle)
libdancer2-perl 0.207000%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,460 kB
  • sloc: perl: 8,069; makefile: 7
file content (32 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package Dancer2::Plugin::DefineKeywords;

use Dancer2::Plugin;

push @::expected_keywords, 'foo';
plugin_keywords foo => sub { 'foo' };

push @::expected_keywords, 'bar';
has bar => (
    is => 'ro',
    plugin_keyword => 1,
    default => sub { 'bar' },
);

push @::expected_keywords, 'baz', 'bazz';
has baz => (
    is => 'ro',
    plugin_keyword => [ qw/ baz bazz / ],
);

push @::expected_keywords, 'biz';
has boz => (
    is => 'ro',
    plugin_keyword => 'biz',
);

push @::expected_keywords, 'quux', 'qiix', 'qox', 'qooox';
sub quux :PluginKeyword { 'quux' };
sub qaax :PluginKeyword(qiix) { die "unimplemented" };
sub qoox :PluginKeyword(qox qooox) { die "unimplemented" };

1;