Class: ParallelEnumerable::Proxy
- Inherits:
-
Object
- Object
- ParallelEnumerable::Proxy
- Defined in:
- lib/parallel_enumerable/proxy.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #each_with_index(&block) ⇒ Object
-
#initialize(enumerable, options = {}) ⇒ Proxy
constructor
A new instance of Proxy.
- #map(&block) ⇒ Object
- #map_with_index(&block) ⇒ Object
Constructor Details
#initialize(enumerable, options = {}) ⇒ Proxy
Returns a new instance of Proxy.
4 5 6 7 |
# File 'lib/parallel_enumerable/proxy.rb', line 4 def initialize(enumerable, ={}) @enumerable = enumerable @options = end |
Instance Method Details
#each(&block) ⇒ Object
9 10 11 |
# File 'lib/parallel_enumerable/proxy.rb', line 9 def each(&block) Parallel.each(@enumerable, @options, &block) end |
#each_with_index(&block) ⇒ Object
13 14 15 |
# File 'lib/parallel_enumerable/proxy.rb', line 13 def each_with_index(&block) Parallel.each_with_index(@enumerable, @options, &block) end |
#map(&block) ⇒ Object
17 18 19 |
# File 'lib/parallel_enumerable/proxy.rb', line 17 def map(&block) Parallel.map(@enumerable, @options, &block) end |
#map_with_index(&block) ⇒ Object
21 22 23 |
# File 'lib/parallel_enumerable/proxy.rb', line 21 def map_with_index(&block) Parallel.map_with_index(@enumerable, @options, &block) end |