Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. # Separate the cases into two statements
  2. @counter ||= 0
  3. @counter += 1
  4.  
  5. # Separate the cases into one conditional
  6. @counter = @counter ? (@counter + 1) : 1
  7.  
  8. # Does not work
  9. (@counter ||= 0) += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement