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