Skip to content

Commit

Permalink
Calculate Collection last? predicate from position
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Oct 10, 2022
1 parent b1031a2 commit d0891f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/phlex/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def yield_items
@collection.each_with_index do |item, index|
@item = item
@index = index
@first = (index == 0)
@last = (index == @collection.size - 1)
@position = (index + 1)
@first = (index == 0)
@last = (@position == @collection.size)

item_template
end
Expand Down

0 comments on commit d0891f8

Please sign in to comment.