Call the stored procedure with the given args
# File lib/sequel/adapters/utils/stored_procedures.rb, line 14 def call(*args, &block) sp = clone sp.sproc_args = args sp.run(&block) end
Programmer friendly string showing this is a stored procedure, showing the name of the procedure.
# File lib/sequel/adapters/utils/stored_procedures.rb, line 22 def inspect "<#{self.class.name}/StoredProcedure name=#{@sproc_name}>" end
Run the stored procedure with the current args on the database
# File lib/sequel/adapters/utils/stored_procedures.rb, line 27 def run(&block) case @sproc_type when :select, :all all(&block) when :first first when :insert insert when :update update when :delete delete end end
Set the type of the stored procedure and override the corresponding _sql method to return the empty string (since the result will be ignored anyway).
# File lib/sequel/adapters/utils/stored_procedures.rb, line 45 def sproc_type=(type) @sproc_type = type meta_def("#{sql_query_type}_sql"){|*a| ''} end
Generated with the Darkfish Rdoc Generator 2.