class Sequel::Postgres::AutoParameterize::StringWithArray

  1. lib/sequel/extensions/pg_auto_parameterize.rb

String that holds an array of parameters

Methods

Public Instance

  1. add_arg
  2. args
  3. inspect

Constants

CAST = '::'.freeze  
PLACEHOLDER = '$'.freeze  

Attributes

args [R]

The array of parameters used by this query.

Public Instance methods

add_arg (s, type=nil)

Add a new parameter to this query, which adds the parameter to the array of parameters, and an SQL placeholder to the query itself.

[show source]
# File lib/sequel/extensions/pg_auto_parameterize.rb, line 78
def add_arg(s, type=nil)
  @args ||= []
  @args << s
  self << PLACEHOLDER << @args.length.to_s
  self << CAST << type.to_s if type
end
inspect ()

Show args when the string is inspected

[show source]
# File lib/sequel/extensions/pg_auto_parameterize.rb, line 86
def inspect
  @args ? "#{self}; #{@args.inspect}".inspect : super
end