好的,这是一个晦涩难懂的问题,但希望有人能帮助我。 我正在处理的系统在存储过程中构建一个用于执行的动态SQL字符串,并且该动态SQL的一部分定义列别名,它们本身实际上是从用户生成数据的另一个表中检索的值。 因此,例如,字符串可能看起来像这样; SELECT table1.Col1 AS "This is an alias" FROM table1
这工作正常。但是,用于别名的值可能包含一个双引
我发现,成功地推翻Time.strftime这样一个来源: class Time
alias :old_strftime :strftime
def strftime
#do something
old_strftime
end
end
麻烦的是,strftime是一个实例方法。我需要重写Time.now - 一种类方法 - 以便让任何呼叫者
换句话说,是不是正确的使用方法:的 public class CustomerList : System.Collections.Generic.List<Customer>
{
/// supposed to be empty
}
代替: using CustomerList = System.Collections.Generic.List<Customer>
我宁愿使用