Ray's playground

 

2010年6月28日

Standard Types(Chapter 6 of Programming Ruby)

摘要: [代码]  In Ruby,these sequences are created using the . . and . . . range operators. The two-dot form createsan inclusive range, and the three-dot form creates a range that excludes the specified highva... 阅读全文

posted @ 2010-06-28 13:00 Ray Z 阅读(129) 评论(0) 推荐(0) 编辑

Sharing Functionality: Inheritance, Modules, and Mixins(Chapter 5 of Programming Ruby)

摘要: Modules are a way of grouping together methods, classes, and constants. Modules give youtwo major benefits:  • Modules provide a namespace and prevent name clashes.  • Modules support the ... 阅读全文

posted @ 2010-06-28 12:43 Ray Z 阅读(265) 评论(0) 推荐(0) 编辑

Containers, Blocks, and Iterators(Chapter 4 of Programming Ruby)

摘要: [代码]injectCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1[1,3,5,7].inject(0){|sum,element|sum+element}#=>162[1,3,5,7].inject(1){|product,element|... 阅读全文

posted @ 2010-06-28 12:38 Ray Z 阅读(156) 评论(0) 推荐(0) 编辑

导航