| Fey documentation | Contained in the Fey distribution. |
Fey::Literal::String - Represents a literal string in a SQL statement
version 0.40
my $string = Fey::Literal::String->new($string)
This class represents a literal string in a SQL statement.
This module is a subclass of Fey::Literal.
This class provides the following methods:
This method creates a new Fey::Literal::String object representing
the string passed to the constructor.
Returns the string as passed to the constructor.
The id for a string is always just the string 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::String; BEGIN { $Fey::Literal::String::VERSION = '0.40'; } use strict; use warnings; use namespace::autoclean; use Fey::Types qw( Str ); use Moose; use MooseX::SemiAffordanceAccessor; use MooseX::StrictConstructor; with 'Fey::Role::Comparable', 'Fey::Role::Selectable', 'Fey::Role::IsLiteral'; has 'string' => ( is => 'ro', isa => Str, required => 1, ); sub BUILDARGS { my $class = shift; return { string => shift }; } sub sql { $_[1]->quote( $_[0]->string() ) } sub sql_with_alias { goto &sql } sub sql_or_alias { goto &sql } __PACKAGE__->meta()->make_immutable(); 1; # ABSTRACT: Represents a literal string in a SQL statement
__END__