Class: Chef::ChefFS::Parallelizer::FlattenEnumerable

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/chef/chef_fs/parallelizer/flatten_enumerable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enum, levels = nil) ⇒ FlattenEnumerable


7
8
9
10
# File 'lib/chef/chef_fs/parallelizer/flatten_enumerable.rb', line 7

def initialize(enum, levels = nil)
  @enum = enum
  @levels = levels
end

Instance Attribute Details

#enumObject (readonly)

Returns the value of attribute enum


12
13
14
# File 'lib/chef/chef_fs/parallelizer/flatten_enumerable.rb', line 12

def enum
  @enum
end

#levelsObject (readonly)

Returns the value of attribute levels


13
14
15
# File 'lib/chef/chef_fs/parallelizer/flatten_enumerable.rb', line 13

def levels
  @levels
end

Instance Method Details

#each(&block) ⇒ Object


15
16
17
18
19
# File 'lib/chef/chef_fs/parallelizer/flatten_enumerable.rb', line 15

def each(&block)
  enum.each do |value|
    flatten(value, levels, &block)
  end
end