Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Created March 19, 2009 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashkenas/81920 to your computer and use it in GitHub Desktop.
Save jashkenas/81920 to your computer and use it in GitHub Desktop.
// 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