File Coverage

blib/lib/Locale/Babelfish/Phrase/Node.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 26 26 100.0


line stmt bran cond sub pod time code
1             package Locale::Babelfish::Phrase::Node;
2              
3             # ABSTRACT: Babelfish AST abstract node.
4              
5 5     5   123028 use utf8;
  5         25  
  5         21  
6 5     5   125 use strict;
  5         8  
  5         86  
7 5     5   19 use warnings;
  5         9  
  5         108  
8              
9 5     5   19 use parent qw( Class::Accessor::Fast );
  5         7  
  5         32  
10              
11             our $VERSION = '2.003'; # VERSION
12              
13              
14             sub new {
15 159     159 1 7653 my ( $class, %args ) = @_;
16 159         832 return bless { %args }, $class;
17             }
18              
19              
20             sub to_perl_escaped_str {
21 66     66 1 2228 my ( $self, $str ) = @_;
22              
23 66         119 $str =~ s/\\/\\\\/g;
24 66         99 $str =~ s/'/\\'/g;
25 66         277 return "'$str'";
26             }
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Locale::Babelfish::Phrase::Node - Babelfish AST abstract node.
39              
40             =head1 VERSION
41              
42             version 2.003
43              
44             =head1 METHODS
45              
46             =head2 new
47              
48             $class->new( %args )
49              
50             Instantiates AST node.
51              
52             =head2 to_perl_escaped_str
53              
54             $str = $node->to_perl_escaped_str
55              
56             Returns node string to be used in Perl source code.
57              
58             =head1 AUTHORS
59              
60             =over 4
61              
62             =item *
63              
64             Akzhan Abdulin <akzhan@cpan.org>
65              
66             =item *
67              
68             Igor Mironov <grif@cpan.org>
69              
70             =item *
71              
72             Victor Efimov <efimov@reg.ru>
73              
74             =item *
75              
76             REG.RU LLC
77              
78             =back
79              
80             =head1 COPYRIGHT AND LICENSE
81              
82             This software is Copyright (c) 2014 by REG.RU LLC.
83              
84             This is free software, licensed under:
85              
86             The MIT (X11) License
87              
88             =cut