Class: ActionView::PartialIteration
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionview/lib/action_view/renderer/collection_renderer.rb |
Class Method Summary
- .new(size) ⇒ PartialIteration constructor
Instance Attribute Summary
-
#first? ⇒ Boolean
readonly
Check if this is the first iteration of the partial.
-
#index
readonly
The current iteration of the partial.
-
#last? ⇒ Boolean
readonly
Check if this is the last iteration of the partial.
-
#size
readonly
The number of iterations that will be done by the partial.
Instance Method Summary
- #iterate! Internal use only
Constructor Details
.new(size) ⇒ PartialIteration
Instance Attribute Details
#first? ⇒ Boolean
(readonly)
Check if this is the first iteration of the partial.
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 19
def first? index == 0 end
#index (readonly)
The current iteration of the partial.
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 11
attr_reader :index
#last? ⇒ Boolean
(readonly)
Check if this is the last iteration of the partial.
#size (readonly)
The number of iterations that will be done by the partial.
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 8
attr_reader :size
Instance Method Details
#iterate!
This method is for internal use only.
[ GitHub ]
# File 'actionview/lib/action_view/renderer/collection_renderer.rb', line 28
def iterate! # :nodoc: @index += 1 end