| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Web::ComposableRequest::Config; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 7 | use namespace::autoclean; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 8 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 1 |  |  | 1 |  | 533 | use Class::Inspector; | 
|  | 1 |  |  |  |  | 2100 |  | 
|  | 1 |  |  |  |  | 30 |  | 
| 6 | 1 |  |  | 1 |  | 7 | use File::Spec::Functions        qw( tmpdir ); | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 59 |  | 
| 7 | 1 |  |  | 1 |  | 6 | use Unexpected::Types            qw( NonEmptySimpleStr PositiveInt Str ); | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 9 |  | 
| 8 | 1 |  |  | 1 |  | 851 | use Web::ComposableRequest::Util qw( merge_attributes is_member ); | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 7 |  | 
| 9 | 1 |  |  | 1 |  | 385 | use Moo; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 7 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | my $_list_attr_of = sub { | 
| 12 |  |  |  |  |  |  | my $class = shift; my @except = qw( BUILDARGS BUILD DOES does new ); | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | return map  { $_->[1] } | 
| 15 |  |  |  |  |  |  | grep { $_->[0] ne 'Moo::Object' and not is_member $_->[1], @except } | 
| 16 |  |  |  |  |  |  | map  { m{ \A (.+) \:\: ([^:]+) \z }mx; [ $1, $2 ] } | 
| 17 |  |  |  |  |  |  | @{ Class::Inspector->methods( $class, 'full', 'public' ) }; | 
| 18 |  |  |  |  |  |  | }; | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | # Public attributes | 
| 21 |  |  |  |  |  |  | has 'encoding'       => is => 'ro', isa => NonEmptySimpleStr, | 
| 22 |  |  |  |  |  |  | default           => 'UTF-8'; | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | has 'max_asset_size' => is => 'ro', isa => PositiveInt, | 
| 25 |  |  |  |  |  |  | default           => 4_194_304; | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | has 'scrubber'       => is => 'ro', isa => Str, | 
| 28 |  |  |  |  |  |  | default           => '[^ +\-\./0-9@A-Z\\_a-z~]'; | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | has 'tempdir'        => is => 'ro', isa => Str, coerce => sub { $_[ 0 ].q() }, | 
| 31 |  |  |  |  |  |  | default           => sub { tmpdir }; | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | # Construction | 
| 34 |  |  |  |  |  |  | around 'BUILDARGS' => sub { | 
| 35 |  |  |  |  |  |  | my ($orig, $self, $config) = @_; my $attr = {}; | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | defined $config | 
| 38 |  |  |  |  |  |  | and merge_attributes $attr, $config, [ $_list_attr_of->( $self ) ]; | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | return $attr; | 
| 41 |  |  |  |  |  |  | }; | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | 1; | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | __END__ |