Class: ParallelEnumerable::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/parallel_enumerable/proxy.rb

Instance Method Summary collapse

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, options={})
  @enumerable = enumerable
  @options = 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