| 1 | package Template::Mustache::Trait; | ||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | # ABSTRACT: turn an attribute into a Mustache template | ||||||||||
| 4 | 1 | $Template::Mustache::Trait::VERSION = '1.4.0'; | |||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use Template::Mustache; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 2 | ▶ | before _process_options => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.0
| |||||||||||
| 12 | 2 | my( $class, $name, $options ) = @_; | |||||||||
| 13 | |||||||||||
| 14 | 2 | ▶ | my $default = $options->{default} or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | |||||||||||
| 16 | 2 | ▶ | $options->{default} = sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 17 | 2 | my $self = shift; | |||||||||
| 18 | 2 | ▶ | Template::Mustache->new( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | template => ref $default ? $default->($self) : $default, | ||||||||||
| 20 | context => $self | ||||||||||
| 21 | ); | ||||||||||
| 22 | 2 | }; | |||||||||
| 23 | 1 | }; | |||||||||
| 24 | |||||||||||
| 25 | package Moose::Meta::Attribute::Custom::Trait::Mustache; | ||||||||||
| 26 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 27 | 1 | $Moose::Meta::Attribute::Custom::Trait::Mustache::VERSION = '1.4.0'; | |||||||||
| 28 | 1 | ▶ | sub register_implementation { 'Template::Mustache::Trait' } | ||||||||
|
Subroutine
register_implementation: called CC=1 SCAR=0.0
| |||||||||||
| 29 | |||||||||||
| 30 | 1 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||