Class: Chef::ChefFS::Parallelizer::ParallelEnumerable::RestrictedLazy

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/chef_fs/parallelizer/parallel_enumerable.rb

Instance Method Summary collapse

Constructor Details

#initialize(parallel_enumerable, actual_lazy) ⇒ RestrictedLazy

Returns a new instance of RestrictedLazy.



117
118
119
120
# File 'lib/chef/chef_fs/parallelizer/parallel_enumerable.rb', line 117

def initialize(parallel_enumerable, actual_lazy)
  @parallel_enumerable = parallel_enumerable
  @actual_lazy = actual_lazy
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



132
133
134
# File 'lib/chef/chef_fs/parallelizer/parallel_enumerable.rb', line 132

def method_missing(method, *args, &block)
  @actual_lazy.send(:method, *args, &block)
end

Instance Method Details

#drop(*args, &block) ⇒ Object



122
123
124
125
# File 'lib/chef/chef_fs/parallelizer/parallel_enumerable.rb', line 122

def drop(*args, &block)
  input = @parallel_enumerable.input_enumerable.lazy.drop(*args, &block)
  @parallel_enumerable.restricted_copy(input)
end

#take(*args, &block) ⇒ Object



127
128
129
130
# File 'lib/chef/chef_fs/parallelizer/parallel_enumerable.rb', line 127

def take(*args, &block)
  input = @parallel_enumerable.input_enumerable.lazy.take(*args, &block)
  @parallel_enumerable.restricted_copy(input)
end