line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fey::Literal::String; |
2
|
|
|
|
|
|
|
|
3
|
28
|
|
|
28
|
|
128
|
use strict; |
|
28
|
|
|
|
|
45
|
|
|
28
|
|
|
|
|
1159
|
|
4
|
28
|
|
|
28
|
|
130
|
use warnings; |
|
28
|
|
|
|
|
44
|
|
|
28
|
|
|
|
|
815
|
|
5
|
28
|
|
|
28
|
|
117
|
use namespace::autoclean; |
|
28
|
|
|
|
|
39
|
|
|
28
|
|
|
|
|
1350
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.42'; |
8
|
|
|
|
|
|
|
|
9
|
28
|
|
|
28
|
|
2281
|
use Fey::Types qw( Str ); |
|
28
|
|
|
|
|
45
|
|
|
28
|
|
|
|
|
200
|
|
10
|
|
|
|
|
|
|
|
11
|
28
|
|
|
28
|
|
120069
|
use Moose 0.90; |
|
28
|
|
|
|
|
739
|
|
|
28
|
|
|
|
|
201
|
|
12
|
28
|
|
|
28
|
|
154461
|
use MooseX::SemiAffordanceAccessor 0.03; |
|
28
|
|
|
|
|
727
|
|
|
28
|
|
|
|
|
195
|
|
13
|
28
|
|
|
28
|
|
79025
|
use MooseX::StrictConstructor 0.07; |
|
28
|
|
|
|
|
624
|
|
|
28
|
|
|
|
|
181
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
with 'Fey::Role::Comparable', 'Fey::Role::Selectable', 'Fey::Role::IsLiteral'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has 'string' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
isa => Str, |
20
|
|
|
|
|
|
|
required => 1, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub BUILDARGS { |
24
|
83
|
|
|
83
|
1
|
154
|
my $class = shift; |
25
|
|
|
|
|
|
|
|
26
|
83
|
|
|
|
|
2420
|
return { string => shift }; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
33
|
|
|
33
|
1
|
1671
|
sub sql { $_[1]->quote( $_[0]->string() ) } |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
2
|
1
|
16
|
sub sql_with_alias { goto &sql } |
32
|
|
|
|
|
|
|
|
33
|
17
|
|
|
17
|
1
|
891
|
sub sql_or_alias { goto &sql } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# ABSTRACT: Represents a literal string in a SQL statement |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=pod |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Fey::Literal::String - Represents a literal string in a SQL statement |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
version 0.42 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSIS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $string = Fey::Literal::String->new($string) |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This class represents a literal string in a SQL statement. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 INHERITANCE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This module is a subclass of C<Fey::Literal>. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 METHODS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This class provides the following methods: |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 Fey::Literal::String->new($string) |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This method creates a new C<Fey::Literal::String> object representing |
72
|
|
|
|
|
|
|
the string passed to the constructor. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 $string->string() |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Returns the string as passed to the constructor. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 $string->id() |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
The id for a string is always just the string itself. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 $string->sql() |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 $string->sql_with_alias() |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 $string->sql_or_alias() |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Returns the appropriate SQL snippet. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 ROLES |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This class does the C<Fey::Role::Selectable> and |
93
|
|
|
|
|
|
|
C<Fey::Role::Comparable> roles. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 BUGS |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
See L<Fey> for details on how to report bugs. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 AUTHOR |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This software is Copyright (c) 2011 - 2015 by Dave Rolsky. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This is free software, licensed under: |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |