aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-16 14:38:07 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-16 14:54:23 -0300
commit7dc0f3fc8d3160db3408ef5a20c43a7268c0cd8e (patch)
tree6fca7dead1cbe00ba10b16ef7c0e6b4249170121 /actionview/lib
parent9290fc5ce213836f666a97e0e458d98e69a920ac (diff)
downloadrails-7dc0f3fc8d3160db3408ef5a20c43a7268c0cd8e.tar.gz
rails-7dc0f3fc8d3160db3408ef5a20c43a7268c0cd8e.tar.bz2
rails-7dc0f3fc8d3160db3408ef5a20c43a7268c0cd8e.zip
Document the PartialIteration object
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/renderer/partial_renderer.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/actionview/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb
index bc0215b6c6..eb8db16796 100644
--- a/actionview/lib/action_view/renderer/partial_renderer.rb
+++ b/actionview/lib/action_view/renderer/partial_renderer.rb
@@ -1,23 +1,29 @@
require 'thread_safe'
module ActionView
- class PartialIteration # :nodoc:
- attr_reader :size, :index
+ class PartialIteration
+ # The number of iterations that will be done by the partial.
+ attr_reader :size
+
+ # The current iteration of the partial.
+ attr_reader :index
def initialize(size)
@size = size
@index = 0
end
+ # Check if this is the first iteration of the partial.
def first?
index == 0
end
+ # Check if this is the last iteration of the partial.
def last?
index == size - 1
end
- def iterate!
+ def iterate! # :nodoc:
@index += 1
end
end