Code/String.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/Number.pm ↑ Summary Code/Expression/Node.pm »
1 package JavaScript::Code::String;
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 2 ▶use base qw[ JavaScript::Code::Type ];
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 2 $VERSION = '0.08';
8
9 =head1 NAME
10
11 JavaScript::Code::String - A JavaScript String Type
12
13 =head1 SYNOPSIS
14
15 #!/usr/bin/perl
16
17 use strict;
18 use warnings;
19 use JavaScript::Code::String;
20
21 my $string = JavaScript::Code::String->new()->value("Go for it!");
22
23 print $string->output;
24
25 =head1 METHODS
26
27 See also the L<JavaScript::Code::Type> documentation.
28
29 =head2 $self->type( )
30
31 =cut
32
33 0 ▶sub type {
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
34 0 return 'String';
35 }
36
37 =head2 $self->output( )
38
39 =cut
40
41 2 ▶sub output {
Subroutine output: called CC=1 SCAR=0.0
Pod documented
42 2 my ($self) = @_;
43
44 2 my $value = $self->value;
45 2 $value =~ s{\"}{\\\"}g;
46
47 2 return qq~"$value"~;
48 }
49
50 =head1 SEE ALSO
51
52 L<JavaScript::Code>
53
54 =head1 AUTHOR
55
56 Sascha Kiefer, C<esskar@cpan.org>
57
58 =head1 LICENSE
59
60 This library is free software, you can redistribute it and/or modify it under
61 the same terms as Perl itself.
62
63 =cut
64
65 2 1;
« Code/Number.pm ↑ Summary Code/Expression/Node.pm »