Вы можете использовать выберите в Hash для этого:
hash = {"1515599671"=>{"Path"=>"images/1515599671.jpeg", "Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>1, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357331"=>{"Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>0, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357336"=>{"Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>0, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357341"=>{"Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>0, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357346"=>{"Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>0, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357448"=>{"Path"=>"images/1525357448.jpeg", "Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>1, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357449"=>{"Path"=>"images/1525357449.jpeg", "Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>1, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}}
hash.select { |key, value| value['Path'] } # Returns key-value pairs only with 'Path' set in its value. Modify the condition to remove empty strings, if you need to
=> {"1515599671"=>{"Path"=>"images/1515599671.jpeg", "Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>1, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357448"=>{"Path"=>"images/1525357448.jpeg", "Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>1, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}, "1525357449"=>{"Path"=>"images/1525357449.jpeg", "Tags"=>{"Anger"=>0, "Disgust"=>0, "FaceDetected"=>1, "Fear"=>0, "Happiness"=>0, "LargeFaceDetected"=>0, "MotionDetected"=>0, "Neutral"=>0, "Sadness"=>0, "Surprise"=>0}}}
# Question update
hash.select { |key, value| value['Path'] && value['Tags'] && (value['Tags']['Anger'] == 1) } # Select those with 'Path' set and 'Tags.Anger' with value 1
=> {} # You don't have any such objects in your example