Permalink
Browse files

more README fixes

  • Loading branch information...
semmypurewal committed Jul 10, 2012
1 parent 2af6010 commit 57e76feb5a76957a2889db5bbfd6e1155a290edd
Showing with 14 additions and 5 deletions.
  1. +14 −5 README.md
View
@@ -112,31 +112,38 @@ Some basic validation is built in as well, so you can define more robust models:
});
Right now, you can do the following with a Model object:
//attribute related
##attribute related
*hasA -- creates an encapsulated attribute
*hasAn -- syntactic sugar for hasA
*hasMany -- creates an encapsulated list of encapsulated attributes
*attributes -- returns an array of attribute names as strings
*attribute -- returns the specified Attr or AttrList object
*parent -- returns the constructor of the parent, if one exists
//method related
## method related
*respondsTo -- creates a method
*methods -- returns an array of method names as string
*method -- returns the specified Method object
//constructor related
## constructor related
*isBuiltWith -- accepts a series of strings that should be attributes, those prepended with '%' are optional in the constructor
-- also accepts an initializer as the final argument
//modifier
## modifier
*isImmutable -- makes the object immutable and forces all attributes to be required in an isBuiltWith call
//inheritance
## inheritance
*isA -- inherits from the specified model
*isAn -- syntactic sugar for isA
Attr and AttrList objects respond to the following methods:
*validatesWith -- accepts a function that returns true if the parameter is valid for the attribute
*defaultsTo -- accepts a default value for the attribute (not currently available for AttrList)
*isImmutable -- makes it so the attribute cannot be changed once it is set
@@ -146,6 +153,7 @@ Attr and AttrList objects respond to the following methods:
*eachOfWhich -- syntactic sugar, a pointer to the Attr object
Attr and AttrList objects also have the following built-in validators
*isGreaterThan
*isLessThan
*isA
@@ -170,5 +178,6 @@ this.message, you also can use this.param to access the setter's actual paramete
AttrList also aliases 'validateWith' for 'validatesWith' to maintain grammatical consistency
We hope to add the following self-explanatory functionality to Attr and AttrList:
*isNotNull
*isNotUndefined

0 comments on commit 57e76fe

Please sign in to comment.