Class Sequel::Postgres::AutoParameterize::StringWithArray
In: lib/sequel/extensions/pg_auto_parameterize.rb
Parent: ::String

String that holds an array of parameters

Methods

add_arg   inspect  

Constants

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

Attributes

args  [R]  The array of parameters used by this query.

Public Instance methods

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

[Source]

    # File lib/sequel/extensions/pg_auto_parameterize.rb, line 78
78:         def add_arg(s, type=nil)
79:           @args ||= []
80:           @args << s
81:           self << PLACEHOLDER << @args.length.to_s
82:           self << CAST << type.to_s if type
83:         end

Show args when the string is inspected

[Source]

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

[Validate]