Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save jakebellacera/02ca0b9a34e9232c4ca6 to your computer and use it in GitHub Desktop.

Select an option

Save jakebellacera/02ca0b9a34e9232c4ca6 to your computer and use it in GitHub Desktop.
an example demoing a DSL for backbone objects
class Something extends Backbone.Model
is: ["validatable", "sortable"]
validations:
phoneNumber:
required:
message: "this is a custom message for when you're missing the phone number!"
matches: /\d{10}/
sortable:
by: "firstName"
order: "desc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment