| 1 | package Facebook::InstantArticle::Author; | ||||||||||
| 2 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | extends 'Facebook::InstantArticle::BaseElement'; | |||||||||
| 6 | |||||||||||
| 7 | 2 | has 'name' => ( | |||||||||
| 8 | isa => 'Str', | ||||||||||
| 9 | is => 'rw', | ||||||||||
| 10 | required => 1, | ||||||||||
| 11 | default => '', | ||||||||||
| 12 | ); | ||||||||||
| 13 | |||||||||||
| 14 | has 'is_valid' => ( | ||||||||||
| 15 | isa => 'Bool', | ||||||||||
| 16 | is => 'ro', | ||||||||||
| 17 | lazy => 1, | ||||||||||
| 18 | default => sub { | ||||||||||
| 19 | 1 | ▶ | my $self = shift; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | return length $self->name ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | }, | ||||||||||
| 23 | 2 | ); | |||||||||
| 24 | |||||||||||
| 25 | 2 | has 'as_xml_gen' => ( | |||||||||
| 26 | isa => 'Object', | ||||||||||
| 27 | is => 'ro', | ||||||||||
| 28 | lazy => 1, | ||||||||||
| 29 | builder => '_build_as_xml_gen', | ||||||||||
| 30 | ); | ||||||||||
| 31 | |||||||||||
| 32 | sub _build_as_xml_gen { | ||||||||||
| 33 | 1 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_build_as_xml_gen: called CC=1 SCAR=0.0
| |||||||||||
| 34 | |||||||||||
| 35 | 1 | my $gen = XML::Generator->new( ':pretty' ); | |||||||||
| 36 | |||||||||||
| 37 | 1 | return $gen->address( | |||||||||
| 38 | $gen->a( $self->name ), | ||||||||||
| 39 | ); | ||||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 2 | 1; | |||||||||