class Sequel::Dataset::PlaceholderLiteralizer::Recorder
Records the offsets at which the placeholder arguments are used in the SQL
query.
Public Instance Methods
arg(v=(no_arg_given = true; @argn+=1))
click to toggle source
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.
# 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)
click to toggle source
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.
# 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)
click to toggle source
Record the offset at which the argument is used in the SQL
query, and any transforming block.
# File lib/sequel/dataset/placeholder_literalizer.rb 96 def use(sql, arg, transformer) 97 @args << [sql, sql.length, arg, transformer] 98 end