Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. @list.each_with_index do |item, idx|
  2. if((idx + 1) % 6 == 0)
  3. # Insert ad partial
  4. end
  5. # Print out each object in the list
  6. end
  7.  
  8. > list = [1,2,3]
  9. #⇒ [1, 2, 3]
  10. > list[1...1] = 0 # insert at position 1
  11. > list
  12. #⇒ [1, 0, 2, 3]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement