class Sequel::SQL::PlaceholderLiteralString
Represents a literal string with placeholders and arguments. This is necessary to ensure delayed literalization of the arguments required for the prepared statement support and for database-specific literalization.
Attributes
The arguments that will be substituted into the placeholders. Either an array of unnamed placeholders (which will be substituted in order for ? characters), or a hash of named placeholders (which will be substituted for :key phrases).
Whether to surround the expression with parentheses
The literal string containing placeholders. This can also be an array of strings, where each arg in args goes between the string elements.
Public Class Methods
Source
# File lib/sequel/sql.rb 1637 def initialize(str, args, parens=false) 1638 @str = str 1639 @args = args.is_a?(Array) && args.length == 1 && (v = args[0]).is_a?(Hash) ? v : args 1640 @parens = parens 1641 freeze 1642 end
Create an object with the given string, placeholder arguments, and parens flag.
Public Instance Methods
Source
# File lib/sequel/sql.rb 1645 def with_parens 1646 @parens ? self : self.class.new(@str, @args, true) 1647 end
Return a copy of the that will be surrounded by parentheses.