随笔分类 - Ruby Rails
Ruby Rails Metaprogramming
摘要:概念Metaprogrammingiswritingcodethatwritescode.Metaprogrammingiswritingcodethatmanipulateslanguageconstructsatruntime.可以编写代码的代码MetaprogrammingRubyThisparticularbrandofmetaprogrammingimpliesthatyouuseaprogramtogenerateorotherwisemanipulateasecond,distinctprogram—andthenyourunthesecondprogram.Afteryouru
阅读全文
摘要:命名约定Rails约定安装和调试ruby186-27_rc2.exe: 这个包含编辑工具scite、语言例子代码、Programming Ruby书等本地安装:rails-2.2.2.zip 解压后gem install rails –l rails-2.2.2.gem联网安装最新的版本gem install rails
阅读全文
摘要:• In Ruby’s object-oriented world, we work with objects and methods. Unlike VB .NET, where some subroutines return a value (Functions) and others do not (Subs), all Ruby methods must return a value. When an explicit return statement is not used, the last-evaluated expression automatically becomes th
阅读全文