# File lib/rbatis.rb, line 378 def statement(statement_type, name = statement_type, params = {}, &proc) statement_type = Statement::SHORTCUTS[statement_type] unless statement_type.respond_to?(:new) statement = statement_type.new(params, &proc) statement.connection_provider = self statement.resultmap = resultmaps[:default] if statement.respond_to?(:resultmap=) && statement.resultmap.nil? statement.validate statements[name] = statement eval "def \#{name}(*args)\nstatements[:\#{name}].execute(*args)\nend\n" end