| 1 | package Valiemon::Attributes::Ref; | ||
| 2 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 5 | ▶ | use parent qw(Valiemon::Attributes); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 5 | ▶ | use Carp qw(croak); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 34 | ▶ | sub attr_name { '$ref' } |
|
Subroutine
attr_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 10 | |||
| 11 | sub is_valid { | ||
| 12 | 51 | ▶ | my ($class, $context, $schema, $data) = @_; |
|
Subroutine
is_valid: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 13 | 51 | my $ref = $schema->{'$ref'}; | |
| 14 | 51 | my $sub_schema = $context->rv->resolve_ref($ref); | |
| 15 | |||
| 16 | $context->in_attr($class, sub { | ||
| 17 | 34 | ▶ | $context->sub_validator($sub_schema)->validate($data, $context); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 18 | 34 | }); | |
| 19 | } | ||
| 20 | |||
| 21 | 5 | 1; | |