Class: ActionView::CollectionRenderer::CollectionIterator
- Inherits:
-
Object
- Object
- ActionView::CollectionRenderer::CollectionIterator
show all
- Includes:
- Enumerable
- Defined in:
- lib/action_view/renderer/collection_renderer.rb
Overview
Instance Method Summary
collapse
Constructor Details
Returns a new instance of CollectionIterator.
39
40
41
|
# File '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 'lib/action_view/renderer/collection_renderer.rb', line 43
def each(&blk)
@collection.each(&blk)
end
|
#length ⇒ Object
51
52
53
|
# File 'lib/action_view/renderer/collection_renderer.rb', line 51
def length
@collection.respond_to?(:length) ? @collection.length : size
end
|
#size ⇒ Object
47
48
49
|
# File 'lib/action_view/renderer/collection_renderer.rb', line 47
def size
@collection.size
end
|