Created
August 9, 2012 14:18
-
-
Save jacaetevha/3304568 to your computer and use it in GitHub Desktop.
Typo in http://www.naildrivin5.com/blog/2012/07/17/adventures-in-functional-programming-with-ruby.html ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_person = ->(person) { | |
| return [nil,"Name is required"] if String(person.(:name)) == '' | |
| return [nil,"Birthdate is required"] if String(person.(:birthdate)) == '' | |
| return [nil,"Gender is required"] if String(person.(:gender)) == '' | |
| return [nil,"Gender must be 'male' or 'female'"] if person.(:gender) != 'male' && | |
| person.(:gender) != 'female' | |
| id = insert_person.(person.(:name),person.(:birthdate),person.(:gender),person.(:title)) | |
| # [new_person.(:with_id,id),nil] # <==== | |
| [person.(:with_id,id),nil] # <==== I think it should be this. Right? | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment