line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::vCard::Precisely::V4::Node::Image; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
172
|
use Carp; |
|
14
|
|
|
|
|
37
|
|
|
14
|
|
|
|
|
1229
|
|
4
|
14
|
|
|
14
|
|
6939
|
use Data::Validate::URI qw(is_web_uri); |
|
14
|
|
|
|
|
626652
|
|
|
14
|
|
|
|
|
986
|
|
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
284
|
use Moose; |
|
14
|
|
|
|
|
38
|
|
|
14
|
|
|
|
|
156
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends qw(Text::vCard::Precisely::V3::Node::Image Text::vCard::Precisely::V4::Node); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has name => ( is => 'rw', default => 'PHOTO', isa => 'Str', required => 1 ); |
11
|
|
|
|
|
|
|
has content => ( is => 'rw', isa => 'Images', required => 1, coerce => 1 ); |
12
|
|
|
|
|
|
|
has media_type => ( is => 'rw', isa => 'Media_type' ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
override 'as_string' => sub { |
15
|
|
|
|
|
|
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
my @lines; |
17
|
|
|
|
|
|
|
push @lines, $self->name() || croak "Empty name"; |
18
|
|
|
|
|
|
|
push @lines, 'ALTID=' . $self->altID() if $self->altID(); |
19
|
|
|
|
|
|
|
push @lines, 'PID=' . join ',', @{ $self->pid() } if $self->pid(); |
20
|
|
|
|
|
|
|
push @lines, "MEDIATYPE=" . $self->media_type() if defined $self->media_type(); |
21
|
|
|
|
|
|
|
push @lines, "ENCODING=b" unless is_web_uri( $self->content() ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $string = join( ';', @lines ) . ':' . $self->content(); |
24
|
|
|
|
|
|
|
return $self->fold( $string, -force => 1 ); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
28
|
14
|
|
|
14
|
|
102217
|
no Moose; |
|
14
|
|
|
|
|
38
|
|
|
14
|
|
|
|
|
96
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |