1.0.1 • Published 9 years ago

haybale v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

haybale

decorate an object prototype with the methods of an object

use

var decorate = require("haybale");


// model prototype
var model = {

  name: "hello"

}

// object with methods
var obj = {
  run: function () {
    console.log("running");
  },
  end: function () {
    console.log("ending");
  }
};


decorate(model, obj);

model.run();

model.end();

api

haybale exposes a single function

decorate(fn, obj)

params

model: the object prototype to be decorated

obj: the object with which to decorate the model