class ActionView::PartialIteration - actionview-4.2.3 Documentation

# class ActionView::PartialIteration

### Attributes

index[R]

The current iteration of the partial.

size[R]

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

### Public Class Methods

new(size) click to toggle source

    # File lib/action_view/renderer/partial_renderer.rb, line 11
    def initialize(size)
      @size  = size
      @index = 0
    end

### Public Instance Methods

first?() click to toggle source

Check if this is the first iteration of the partial.

    # File lib/action_view/renderer/partial_renderer.rb, line 17
    def first?
      index == 0
    end

last?() click to toggle source

Check if this is the last iteration of the partial.

    # File lib/action_view/renderer/partial_renderer.rb, line 22
    def last?
      index == size - 1
    end