1.0.2 • Published 10 years ago

ws-oop.js v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

#OOP.js

A set of methods that help with object orientated programming in javascript.

Note: All credit goes to the coffescript homepage from where the code originated (http://coffeescript.org/#classes).

##Installation

npm install OOP.js

##Usage - extends.

Assuming your classes are laid out in the following way....

```js

var Dog;

Dog = (function() {

	function Dog()
	{

	};

	return Dog;

})();

```

Import oop to use inheritance and pass the parent class variable to the wrapper function.

```js

var OOP = require('oop'),
	Animal = require('animal');

var Dog;

Dog = (function(_super) {

	OOP.__extends(Dog, _super);

	function Dog()
	{

	};

	return Dog;

})(animal);

```

##License

See "LICENSE" file.