Class: ActionView::CollectionRenderer::MixedCollectionIterator

Inherits:
CollectionIterator show all
Defined in:
lib/action_view/renderer/collection_renderer.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from CollectionIterator

#each, #length, #size

Constructor Details

#initialize(collection, paths) ⇒ MixedCollectionIterator

Returns a new instance of MixedCollectionIterator.



93
94
95
96
# File 'lib/action_view/renderer/collection_renderer.rb', line 93

def initialize(collection, paths)
  super(collection)
  @paths = paths
end

Instance Method Details

#each_with_infoObject



98
99
100
101
# File 'lib/action_view/renderer/collection_renderer.rb', line 98

def each_with_info
  return enum_for(:each_with_info) unless block_given?
  @collection.each_with_index { |o, i| yield(o, @paths[i]) }
end