Module: Sequel::Dataset::StoredProcedureMethods
- Defined in:
- lib/sequel/adapters/utils/stored_procedures.rb
Instance Method Summary collapse
-
#call(*args, &block) ⇒ Object
Call the stored procedure with the given args.
-
#inspect ⇒ Object
Programmer friendly string showing this is a stored procedure, showing the name of the procedure.
-
#run(&block) ⇒ Object
Run the stored procedure with the current args on the database.
-
#sproc_name ⇒ Object
The name of the stored procedure to call.
Instance Method Details
#call(*args, &block) ⇒ Object
Call the stored procedure with the given args
14 15 16 |
# File 'lib/sequel/adapters/utils/stored_procedures.rb', line 14 def call(*args, &block) clone(:sproc_args=>args).run(&block) end |
#inspect ⇒ Object
Programmer friendly string showing this is a stored procedure, showing the name of the procedure.
20 21 22 |
# File 'lib/sequel/adapters/utils/stored_procedures.rb', line 20 def inspect "<#{self.class.name}/StoredProcedure name=#{@sproc_name}>" end |
#run(&block) ⇒ Object
Run the stored procedure with the current args on the database
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sequel/adapters/utils/stored_procedures.rb', line 25 def run(&block) case @opts[:sproc_type] when :select, :all all(&block) when :first first when :insert insert when :update update when :delete delete end end |
#sproc_name ⇒ Object
The name of the stored procedure to call
9 10 11 |
# File 'lib/sequel/adapters/utils/stored_procedures.rb', line 9 def sproc_name @opts[:sproc_name] end |