| Fey documentation | Contained in the Fey distribution. |
Fey::Literal::Number - Represents a literal number in a SQL statement
version 0.40
my $number = Fey::Literal::Number->new($number)
This class represents a literal number in a SQL statement, either an integer or float.
This module is a subclass of Fey::Literal.
This class provides the following methods:
This method creates a new Fey::Literal::Number object representing
the number passed to the constructor.
Returns the number as passed to the constructor.
The id for a number is always just the number itself.
Returns the appropriate SQL snippet.
This class does the Fey::Role::Selectable and
Fey::Role::Comparable roles.
See Fey for details on how to report bugs.
Dave Rolsky <autarch@urth.org>
This software is Copyright (c) 2011 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
| Fey documentation | Contained in the Fey distribution. |
package Fey::Literal::Number; BEGIN { $Fey::Literal::Number::VERSION = '0.40'; } use strict; use warnings; use namespace::autoclean; use Fey::Types qw( Num ); use Moose; use MooseX::SemiAffordanceAccessor; use MooseX::StrictConstructor; with 'Fey::Role::Comparable', 'Fey::Role::Selectable', 'Fey::Role::IsLiteral'; has 'number' => ( is => 'ro', isa => Num, required => 1, ); sub BUILDARGS { my $class = shift; return { number => shift }; } sub sql { $_[0]->number() } sub sql_with_alias { goto &sql } sub sql_or_alias { goto &sql } __PACKAGE__->meta()->make_immutable(); 1; # ABSTRACT: Represents a literal number in a SQL statement
__END__