Methods

Attributes

[R] index

The current iteration of the partial.

[R] size

The number of iterations that will be done by the partial.

Class Public methods

new(size)

📝 Source code
# File actionview/lib/action_view/renderer/partial_renderer.rb, line 14
    def initialize(size)
      @size  = size
      @index = 0
    end
🔎 See on GitHub

Instance Public methods

first?()

Check if this is the first iteration of the partial.

📝 Source code
# File actionview/lib/action_view/renderer/partial_renderer.rb, line 20
    def first?
      index == 0
    end
🔎 See on GitHub

last?()

Check if this is the last iteration of the partial.

📝 Source code
# File actionview/lib/action_view/renderer/partial_renderer.rb, line 25
    def last?
      index == size - 1
    end
🔎 See on GitHub