Created
March 19, 2009 16:35
-
-
Save jashkenas/81920 to your computer and use it in GitHub Desktop.
This file contains 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
// API maybes for a ZenItem#toParams() | |
// If no fields are specified, then the result is a ZenItem#toObject() | |
// If fields are specified, then we either call the method, or do a get() for the property | |
// if no method of that name exists on the object. | |
// If {safe : false} is passed, any of the results that are SafeStrings will be unsafe'd. | |
user.toParams(); | |
user.toParams({safe : false}); | |
user.toParams('name', 'email', 'role'); | |
user.toParams('name', 'email', 'role', {safe : false}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment