line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wikibase::Datatype::Print::Value::Globecoordinate; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
916743
|
use base qw(Exporter); |
|
44
|
|
|
|
|
186
|
|
|
44
|
|
|
|
|
4115
|
|
4
|
44
|
|
|
44
|
|
290
|
use strict; |
|
44
|
|
|
|
|
120
|
|
|
44
|
|
|
|
|
859
|
|
5
|
44
|
|
|
44
|
|
211
|
use warnings; |
|
44
|
|
|
|
|
137
|
|
|
44
|
|
|
|
|
1402
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
1193
|
use Error::Pure qw(err); |
|
44
|
|
|
|
|
23023
|
|
|
44
|
|
|
|
|
1823
|
|
8
|
44
|
|
|
44
|
|
406
|
use Readonly; |
|
44
|
|
|
|
|
124
|
|
|
44
|
|
|
|
|
8026
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(print); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = 0.09; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub print { |
15
|
3
|
|
|
3
|
1
|
1540
|
my ($obj, $opts_hr) = @_; |
16
|
|
|
|
|
|
|
|
17
|
3
|
100
|
|
|
|
24
|
if (! $obj->isa('Wikibase::Datatype::Value::Globecoordinate')) { |
18
|
1
|
|
|
|
|
5
|
err "Object isn't 'Wikibase::Datatype::Value::Globecoordinate'."; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
10
|
my $ret = '('.$obj->latitude.', '.$obj->longitude.')'; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
45
|
return $ret; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding utf8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Wikibase::Datatype::Print::Value::Globecoordinate - Wikibase globe coordinate value pretty print helpers. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
use Wikibase::Datatype::Print::Value::Globecoordinate qw(print); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $pretty_print_string = print($obj, $opts_hr); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SUBROUTINES |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 C<print> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $pretty_print_string = print($obj, $opts_hr); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Construct pretty print output for L<Wikibase::Datatype::Value::Globecoordinate> |
51
|
|
|
|
|
|
|
object. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Returns string. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 ERRORS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
print(): |
58
|
|
|
|
|
|
|
Object isn't 'Wikibase::Datatype::Value::Globecoordinate'. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 EXAMPLE |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=for comment filename=create_and_print_value_globecoordinate.pl |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
use strict; |
65
|
|
|
|
|
|
|
use warnings; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
use Wikibase::Datatype::Print::Value::Globecoordinate; |
68
|
|
|
|
|
|
|
use Wikibase::Datatype::Value::Globecoordinate; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# Object. |
71
|
|
|
|
|
|
|
my $obj = Wikibase::Datatype::Value::Globecoordinate->new( |
72
|
|
|
|
|
|
|
'value' => [49.6398383, 18.1484031], |
73
|
|
|
|
|
|
|
); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# Print. |
76
|
|
|
|
|
|
|
print Wikibase::Datatype::Print::Value::Globecoordinate::print($obj)."\n"; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# Output: |
79
|
|
|
|
|
|
|
# (49.6398383, 18.1484031) |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L<Error::Pure>, |
84
|
|
|
|
|
|
|
L<Exporter>, |
85
|
|
|
|
|
|
|
L<Readonly>. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 SEE ALSO |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=over |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item L<Wikibase::Datatype::Value::Globecoordinate> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Wikibase globe coordinate value datatype. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=back |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 REPOSITORY |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L<https://github.com/michal-josef-spacek/Wikibase-Datatype-Print> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 AUTHOR |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Michal Josef Špaček L<mailto:skim@cpan.org> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
L<http://skim.cz> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
© 2020-2023 Michal Josef Špaček |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
BSD 2-Clause License |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 VERSION |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
0.09 |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |