Extensible, storage-agnostic object models, backbone-style
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

registrar

Build Status

Extensible, storage-agnostic object models, backbone-style.

Example

var Model = require('registrar').Model;

// define a new model
var Person = Model.extend({
  // add your instance methods
  logExample: function() {
    console.log(this.name, 'is', this.age, 'years old.')
  }
});

// create a new instance of that model
var person = new Person({ name: 'Ben', 'age': 29 });

// run the instance method
person.logExample();

// set a value on that instance
person.set('age', 30);

// run the instance method again
person.logExample();