File Coverage

blib/lib/CXC/Form/Tiny/Plugin/OptArgs2.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 1 1 100.0
total 38 38 100.0


line stmt bran cond sub pod time code
1             package CXC::Form::Tiny::Plugin::OptArgs2;
2              
3             # ABSTRACT: A Plugin to interface Form::Tiny with OptArgs2
4              
5 6     6   2950972 use v5.20;
  6         23  
6              
7 6     6   44 use warnings;
  6         13  
  6         382  
8 6     6   585 use experimental 'signatures', 'postderef';
  6         1424  
  6         110  
9              
10             our $VERSION = '0.12';
11              
12 6     6   1595 use parent 'Form::Tiny::Plugin';
  6         15  
  6         39  
13              
14             ## no critic (Subroutines::ProtectPrivateSubs)
15              
16 15     15 1 547041 sub plugin ( $self, $caller, $context ) {
  15         51  
  15         36  
  15         29  
  15         30  
17             return {
18 31         105 roles => [ q{CXC::Form::Tiny::Plugin::OptArgs2::Class}, ],
19             meta_roles => [ q{CXC::Form::Tiny::Plugin::OptArgs2::Meta}, ],
20             subs => {
21 31     31   249 option => sub ( @options ) {
  31         47  
22 31         149 $caller->form_meta->_dsl_add_option( $context->$*, @options );
23             },
24              
25 4     4   21 argument => sub ( @options ) {
  4         15  
  4         7  
26 4         22 $caller->form_meta->_dsl_add_argument( $context->$*, @options );
27             },
28              
29 6     6   180655 optargs_opts => sub ( @options ) {
  6         22  
  6         13  
30 6         33 $caller->form_meta->_dsl_optargs_opts( $context->$*, @options );
31             },
32              
33             },
34              
35 15         295 };
36             }
37              
38             #
39             # This file is part of CXC-Form-Tiny-Plugin-OptArgs2
40             #
41             # This software is Copyright (c) 2023 by Smithsonian Astrophysical Observatory.
42             #
43             # This is free software, licensed under:
44             #
45             # The GNU General Public License, Version 3, June 2007
46             #
47              
48             1;
49              
50             __END__