Ruby: Using .all? when the variable can be an empty array
Context You have an array of hashes and want to check if all elements are satisfying a condition. TIL You might want to do this in Ruby: objects.all? { _1[:amount] > 10 } In this case, you should remember according to with the documentation .all? mi...
Dec 10, 20211 min read281
