Classes which include Denumerable will get versions of map, select, and so on, which return a Denumerator, so that they work horizontally without creating intermediate arrays.
# File lib/core/facets/denumerable.rb, line 13
13: def map
14: Denumerator.new do |output|
15: each do |*input|
16: output.yield yield(*input)
17: end
18: end
19: end
# File lib/core/facets/denumerable.rb, line 33
33: def reject
34: Denumerator.new do |output|
35: each do |*input|
36: output.yield(*input) unless yield(*input)
37: end
38: end
39: end
# File lib/core/facets/denumerable.rb, line 23
23: def select
24: Denumerator.new do |output|
25: each do |*input|
26: output.yield(*input) if yield(*input)
27: end
28: end
29: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.