Class: ActionView::CollectionRenderer::CollectionIterator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
actionview/lib/action_view/renderer/collection_renderer.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from Enumerable

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

Constructor Details

#initialize(collection) ⇒ CollectionIterator

Returns a new instance of CollectionIterator.


39
40
41
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 39

def initialize(collection)
  @collection = collection
end

Instance Method Details

#each(&blk) ⇒ Object


43
44
45
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 43

def each(&blk)
  @collection.each(&blk)
end

#sizeObject


47
48
49
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 47

def size
  @collection.size
end