Class: Sequel::SQL::PlaceholderLiteralString

Inherits:
Expression show all
Defined in:
lib/sequel/lib/sequel/sql.rb

Overview

Represents a literal string with placeholders and arguments. This is necessary to ensure delayed literalization of the arguments required for the prepared statement support

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

#lit

Constructor Details

#initialize(str, args, parens = false) ⇒ PlaceholderLiteralString

Create an object with the given string, placeholder arguments, and parens flag.


664
665
666
667
668
# File 'lib/sequel/lib/sequel/sql.rb', line 664

def initialize(str, args, parens=false)
  @str = str
  @args = args
  @parens = parens
end

Instance Attribute Details

#argsObject (readonly)

The arguments that will be subsituted into the placeholders.


655
656
657
# File 'lib/sequel/lib/sequel/sql.rb', line 655

def args
  @args
end

#parensObject (readonly)

Whether to surround the expression with parantheses


661
662
663
# File 'lib/sequel/lib/sequel/sql.rb', line 661

def parens
  @parens
end

#strObject (readonly)

The literal string containing placeholders


658
659
660
# File 'lib/sequel/lib/sequel/sql.rb', line 658

def str
  @str
end