Code/Number.pm

filter: Statementstmt 93.7% 15 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 91.3% 21 / 23 CC 1 SCAR 1.8
CC
1
Cov
94%
type
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Code/Function/Result.pm ↑ Summary Code/String.pm »
1 package JavaScript::Code::Number;
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use vars qw[ $VERSION ];
Subroutine BEGIN: called CC=1 SCAR=0.0
5 use base
6 2 ▶ qw[ JavaScript::Code::Type JavaScript::Code::Expression::Node::Arithmetic ];
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 2 $VERSION = '0.08';
9
10 =head1 NAME
11
12 JavaScript::Code::Number - A JavaScript Number Type
13
14 =head1 SYNOPSIS
15
16 #!/usr/bin/perl
17
18 use strict;
19 use warnings;
20 use JavaScript::Code::Number;
21
22 my $number = JavaScript::Code::String->new( value => 42 );
23
24 print $number->output;
25
26 =head1 METHODS
27
28 See also the L<JavaScript::Code::Type> documentation.
29
30 =cut
31
32 =head2 $self->type( )
33
34 =cut
35
36 0 ▶sub type {
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
37 0 return "Number";
38 }
39
40 =head2 $self->output( )
41
42 =cut
43
44 2 ▶sub output {
Subroutine output: called CC=1 SCAR=0.0
Pod documented
45 2 my ($self) = @_;
46
47 2 my $value = $self->value;
48 2 $value += 0; # make sure it is a number
49
50 2 return "$value";
51 }
52
53 =head1 SEE ALSO
54
55 L<JavaScript::Code>
56
57 =head1 AUTHOR
58
59 Sascha Kiefer, C<esskar@cpan.org>
60
61 =head1 LICENSE
62
63 This library is free software, you can redistribute it and/or modify it under
64 the same terms as Perl itself.
65
66 =cut
67
68 2 1;
« Code/Function/Result.pm ↑ Summary Code/String.pm »