[读书笔记] - Ruby 中的 Enumerator

2015-05-07
阅读 3 分钟
3.1k
Ruby comes with a built-in Enumerator class, which implements external iterators in Ruby.

[读书笔记] Ruby 中的 Block 和 Iterator

2015-04-24
阅读 5 分钟
3.2k
By making square block-local, values assigned inside the block will not affect the value of the variable with the same name in the outer scope.

【读书笔记】Ruby 中的 Array 和 Hash

2015-04-08
阅读 3 分钟
3.3k
Array Define Arrays 字面值直接定义 {代码...} 创建一个 Array Object {代码...} 创建字符串数组的简便方式 {代码...} Index Array Array 可通过 [] 操作符,使用整数来索引。 {代码...} 使用 Range 来索引, 返回一个区间的数组值 {代码...} [start,count] 返回起点至距离起点一定距离区间内的数组织,起点处为距离1 {...