Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @list.each_with_index do |item, idx|
- if((idx + 1) % 6 == 0)
- # Insert ad partial
- end
- # Print out each object in the list
- end
- > list = [1,2,3]
- #⇒ [1, 2, 3]
- > list[1...1] = 0 # insert at position 1
- > list
- #⇒ [1, 0, 2, 3]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement