Permalink
Browse files

[docs] Add timestamps() to README

  • Loading branch information...
1 parent 2df8769 commit dfee8aa792e47f580739b7ce1d286dc89dc83ce7 @pksunkara pksunkara committed Dec 29, 2011
Showing with 9 additions and 0 deletions.
  1. +7 −0 README.md
  2. +2 −0 examples/creature-function.js
View
7 README.md
@@ -19,6 +19,11 @@ A storage agnostic resource-oriented ODM for building prototypical models with v
this.string('diet');
this.bool('vertebrate');
this.array('belly');
+
+ //
+ // Specify timestamp properties
+ //
+ this.timestamps();
});
//
@@ -52,11 +57,13 @@ The returned `Creature` object is a *resource constructor*, in other words, a *f
Creature.string('diet');
Creature.bool('vertebrate');
Creature.array('belly');
+ Creature.object('children');
// Are equivalent to
Creature.property('diet'); // Defaults to String
Creature.property('vertebrate', Boolean);
Creature.property('belly', Array);
+ Creature.property('children', Object);
```
And add a method to the prototype:
View
2 examples/creature-function.js
@@ -5,6 +5,8 @@ var Creature = resourceful.define('creature', function () {
this.bool('vertebrate');
this.array('belly');
+ this.timestamps();
+
this.prototype.feed = function (food) {
this.belly.push(food);
};

0 comments on commit dfee8aa

Please sign in to comment.