line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fey::Literal::Number; |
2
|
|
|
|
|
|
|
|
3
|
28
|
|
|
28
|
|
137
|
use strict; |
|
28
|
|
|
|
|
35
|
|
|
28
|
|
|
|
|
1127
|
|
4
|
28
|
|
|
28
|
|
127
|
use warnings; |
|
28
|
|
|
|
|
35
|
|
|
28
|
|
|
|
|
1025
|
|
5
|
28
|
|
|
28
|
|
123
|
use namespace::autoclean; |
|
28
|
|
|
|
|
31
|
|
|
28
|
|
|
|
|
200
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.42'; |
8
|
|
|
|
|
|
|
|
9
|
28
|
|
|
28
|
|
2309
|
use Fey::Types qw( Num ); |
|
28
|
|
|
|
|
37
|
|
|
28
|
|
|
|
|
198
|
|
10
|
|
|
|
|
|
|
|
11
|
28
|
|
|
28
|
|
123840
|
use Moose 0.90; |
|
28
|
|
|
|
|
761
|
|
|
28
|
|
|
|
|
194
|
|
12
|
28
|
|
|
28
|
|
153175
|
use MooseX::SemiAffordanceAccessor 0.03; |
|
28
|
|
|
|
|
749
|
|
|
28
|
|
|
|
|
181
|
|
13
|
28
|
|
|
28
|
|
79862
|
use MooseX::StrictConstructor 0.07; |
|
28
|
|
|
|
|
616
|
|
|
28
|
|
|
|
|
171
|
|
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
|
238
|
my $class = shift; |
25
|
|
|
|
|
|
|
|
26
|
154
|
|
|
|
|
4176
|
return { number => shift }; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
115
|
|
|
115
|
1
|
2873
|
sub sql { $_[0]->number() } |
30
|
|
|
|
|
|
|
|
31
|
56
|
|
|
56
|
1
|
170
|
sub sql_with_alias { goto &sql } |
32
|
|
|
|
|
|
|
|
33
|
48
|
|
|
48
|
1
|
130
|
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.42 |
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 |