class Sequel::Dataset::PlaceholderLiteralizer::Recorder

  1. lib/sequel/dataset/placeholder_literalizer.rb
Superclass: Object

Records the offsets at which the placeholder arguments are used in the SQL query.

Methods

Public Instance

  1. arg
  2. loader
  3. use

Public Instance methods

arg(v=(no_arg_given = true; @argn+=1))

Return an Argument with the specified position, or the next position. In general you shouldn’t mix calls with an argument and calls without an argument for the same receiver.

[show source]
   # File lib/sequel/dataset/placeholder_literalizer.rb
87 def arg(v=(no_arg_given = true; @argn+=1))
88   unless no_arg_given
89     @argn = v if @argn < v
90   end
91   Argument.new(self, v)
92 end
loader(pl, dataset, &block)

Yields the receiver and the dataset to the block, which should call arg on the receiver for each placeholder argument, and return the dataset that you want to load.

[show source]
   # File lib/sequel/dataset/placeholder_literalizer.rb
80 def loader(pl, dataset, &block)
81   pl.new(*process(dataset, &block))
82 end
use(sql, arg, transformer)

Record the offset at which the argument is used in the SQL query, and any transforming block.

[show source]
   # File lib/sequel/dataset/placeholder_literalizer.rb
96 def use(sql, arg, transformer)
97   @args << [sql, sql.length, arg, transformer]
98 end