Class: ActionView::CollectionRenderer::MixedCollectionIterator

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from CollectionIterator

#each, #size

Methods included from Enumerable

#as_json, #compact_blank, #exclude?, #excluding, #including, #index_by, #index_with, #many?, #pick, #pluck, #sum, #without

Constructor Details

#initialize(collection, paths) ⇒ MixedCollectionIterator

Returns a new instance of MixedCollectionIterator.


89
90
91
92
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 89

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

Instance Method Details

#each_with_infoObject


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

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