Class: ActionView::CollectionRenderer::CollectionIterator
- Inherits:
-
Object
- Object
- ActionView::CollectionRenderer::CollectionIterator
show all
- Includes:
- Enumerable
- Defined in:
- actionview/lib/action_view/renderer/collection_renderer.rb
Overview
Instance Method Summary
collapse
Methods included from Enumerable
#as_json
Constructor Details
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
|
51
52
53
|
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 51
def length
@collection.respond_to?(:length) ? @collection.length : size
end
|
55
56
57
|
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 55
def preload!
end
|
47
48
49
|
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 47
def size
@collection.size
end
|