File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 11package Net::RDAP::JCard::Property ;
2- use List::Util qw( pairmap ) ;
2+ use List::Util qw( any ) ;
33use strict;
44use warnings;
55
6+ my @URI_TYPES = qw( source logo member related sound uid uri caladruri caluri contact-uri socialprofile impp url email) ;
7+
68=pod
79
810=head1 NAME
@@ -118,7 +120,14 @@ Returns a string containing the property value type. See the L<vCard Value Data
118120Types|https://www.iana.org/assignments/vcard-elements/vcard-elements.xhtml#value-data-types>
119121IANA registry for a list of possible values.
120122
121- This method will always return the value type in UPPERCASE.
123+ This method will always return the value type in lowercase.
124+
125+ =head2 URIness
126+
127+ Some properties may be URIs, depending on the property type and value type. The
128+ C<may_be_uri() > method will return a true value if the property value may be a
129+ URI (either because of the specification of its type, or the value of its
130+ C<value_type() > .
122131
123132=head2 PROPERTY VALUE
124133
@@ -156,6 +165,19 @@ sub TO_JSON {
156165 ];
157166}
158167
168+ sub may_be_uri {
169+ my $self = shift ;
170+ if (q{ uri} eq $self -> value_type) {
171+ return 1;
172+
173+ } elsif (any { $_ eq $self -> type } @URI_TYPES ) {
174+ return 1;
175+
176+ }
177+
178+ return undef ;
179+ }
180+
159181=pod
160182
161183=head1 COPYRIGHT
You can’t perform that action at this time.
0 commit comments