Tag: 铁木

Ruby开发入门

什么是一些很好的在线教程/快速入门/截屏video,以加快Ruby开发的速度? 我最近在2008年9月/ 10月的CoDe杂志上阅读了Brad Wilson的Ruby文章,并希望继续沿着Ruby / IronRuby路径前进。 (我的背景主要是C#和.NET。)

Ruby中的可选parens用于带大写起始字母的方法?

我刚刚开始使用IronRuby(但是当我在普通的Ruby中测试它时,行为似乎是一致的)我的.NET应用程序中的DSL – 作为其中的一部分,我定义了通过define_method从DSL调用的方法。 但是,在调用以大写字母开头的方法时,我遇到了关于可选parens的问题。 鉴于以下计划: class DemoClass define_method :test do puts “output from test” end define_method :Test do puts “output from Test” end def run puts “Calling ‘test'” test() puts “Calling ‘test'” test puts “Calling ‘Test()'” Test() puts “Calling ‘Test'” Test end end demo = DemoClass.new demo.run 在控制台中运行此代码(使用普通ruby)会产生以下输出: ruby .\test.rb Calling ‘test’ output from test […]