MapFeatures/Feature/Value/NumWithUnit.pm

filter: Statementstmt 60.0% 15 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 57.5% 19 / 33 CC 1 SCAR 2.9
CC
1
Cov
60%
init
2.0
stringify
2.0
BEGIN
1.0
CRAP 1.3
« MapFeatures/Feature/Value/List.pm ↑ Summary MapFeatures/Feature/Value/Range.pm »
1 package Geo::OSM::MapFeatures::Feature::Value::NumWithUnit;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use overload '""' => \&stringify;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use base qw(Geo::OSM::MapFeatures::Feature::Value);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 Geo::OSM::MapFeatures::Feature::Value::NumWithUnit - Numeric value with unit
13  
14 =head1 VERSION
15  
16 Version 0.01
17  
18 =cut
19  
20 2 our $VERSION = '0.01';
21  
22  
23 =head1 SYNOPSIS
24  
25 =head1 FUNCTIONS
26  
27 =head2 units
28  
29 Returns a reference to a list of units
30  
31 =cut
32  
33 2 __PACKAGE__->mk_accessors(qw(units));
34  
35 =pod
36  
37 =cut
38  
39 0 ▶sub init {
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
40 0 my $self = shift;
41 0 my $value = shift;
42 0 my %classargs = %{ shift() };
43  
44 0 $self->units($classargs{units});
45  
46 0 return $self;
47 }
48  
49 0 ▶sub stringify {
Subroutine stringify: not called CC=1 SCAR=6.9
Pod undocumented
50 0 my $self = shift;
51 0 my @units = @{ $self->units() };
52  
53 0 return sprintf("Number with unit: %s", join(', ', @units));
54 }
55  
56 =head1 AUTHOR
57  
58 Knut Arne Bjørndal, C<< <bob at cakebox.net> >>
59  
60 =head1 BUGS
61  
62 Please report any bugs or feature requests to C<bug-geo-osm-mapfeatures-feature-value-numwithunit at rt.cpan.org>, or through
63 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-OSM-MapFeatures>. I will be notified, and then you'll
64 automatically be notified of progress on your bug as I make changes.
65  
66  
67  
68  
69 =head1 SUPPORT
70  
71 You can find documentation for this module with the perldoc command.
72  
73 perldoc Geo::OSM::MapFeatures
74  
75  
76 You can also look for information at:
77  
78 =over 4
79  
80 =item * RT: CPAN's request tracker
81  
82 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Geo-OSM-MapFeatures>
83  
84 =item * AnnoCPAN: Annotated CPAN documentation
85  
86 L<http://annocpan.org/dist/Geo-OSM-MapFeatures>
87  
88 =item * CPAN Ratings
89  
90 L<http://cpanratings.perl.org/d/Geo-OSM-MapFeatures>
91  
92 =item * Search CPAN
93  
94 L<http://search.cpan.org/dist/Geo-OSM-MapFeatures>
95  
96 =back
97  
98  
99 =head1 ACKNOWLEDGEMENTS
100  
101  
102 =head1 COPYRIGHT & LICENSE
103  
104 Copyright 2008-2009 Knut Arne Bjørndal, all rights reserved.
105  
106 This program is free software; you can redistribute it and/or modify it
107 under the same terms as Perl itself.
108  
109  
110 =cut
111  
112 2 1; # End of Geo::OSM::MapFeatures::Feature::Value::NumWithUnit
« MapFeatures/Feature/Value/List.pm ↑ Summary MapFeatures/Feature/Value/Range.pm »