Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

student.tests.inject(false) {|acc, test| acc || (!test.taken? )}

can be reduced even further using the all? method

!student.tests.all?(&:taken?)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: