在bigbold上看到Get the currently running method name in Ruby
代码片段:
module Kernel private def this_method_name caller =~ /`(*)'/ and $1 endendclass Foo def test ...……
scaffold is moved out of the core of ror since 2.0, just need to generate it.
render_text is out of date in ror2.0
some usefull links:
http://www.aptana.com/docs/index.php/Getting_started_rollin……
Block
Block 不是对象,是Ruby的语言特性,近似于闭包(Closure)。
范例:
def meth res= yield amp;quot;Block called returns #{res}amp;quot;endputs meth do next “next_value” end #Bloc ...……
从.NET诞生之日起就有了XML类库,但是从使用上来说非常不方便。例如我们需要构造一个XML文档时,使用DOM API就要这样搞: var xmlDoc = new XmlDocument();
var rootEle = xmlDoc.CreateElement(amp;quot;personsam ...……