<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## inherit

origin inherit from node util
BUT super called like "super"

**Parameters**

-   `ctor` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor to extend
-   `superCtor` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor which will be installed as "super"

**Examples**

```javascript
var inherit = require('s-inherit');
var DecoratedClass = inherit(Class, Parent);
```

Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor

## inherit.\_related

Make new Constructor with nested construction of a chain of prototypes
hard relation of child constructor to parent constructor.
The "super" defined from static method "\_setSuper".
If it absent Constructor lose ability call to Parent.

**Parameters**

-   `Child` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor to extend
-   `Parent` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor which will be installed as "super"

**Examples**

```javascript
var inherit = require('s-inherit');
//
function Parent () { ... }
//
function Child ( data ) {
// Adding personal owned properties to the parent
this.superUniqueProperty.call(this, data);
// own properties of the constructor and/or overrides
this.props = 1;
}
Child._setSuper = function ( Parent ) {
this.superUniqueProperty = Parent;
}
// Constructor with nested construction of a chain of prototypes
var Inheritor = inherit._related(Child, Parent);
```

Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor

## inherit.extend

Make new Constructor with nested construction of a chain of prototypes
hard relation of child constructor to parent constructor.
The "super" defined from static method "\_setSuper".
If it absent Constructor lose ability call to Parent context.
No limit for nested construction of a chain of prototypes.

**Parameters**

-   `Child` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor to extend
-   `Parent` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor which will be installed as "super"
-   `Parent` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** constructor which will be installed as "super" as many times as you need

**Examples**

```javascript
var inherit = require('s-inherit');
// it will give ability to combine inheritance any to any
function Parent1 () { ... }
Parent1._setSuper = function ( Parent ) { this.p1 = Parent; }
function Parent2 () { ... }
Parent2._setSuper = function ( Parent ) { this.p2 = Parent; }
function Parent3 () { ... }
Parent3._setSuper = function ( Parent ) { this.p3 = Parent; }
function Parent4 () { ... }
Parent4._setSuper = function ( Parent ) { this.p4 = Parent; }
//
function Child ( data ) {
// Adding personal owned properties to the parent
this.superUniqueProperty.call(this, data);
// own properties of the constructor and/or overrides
this.props = 1;
}
Child._setSuper = function ( Parent ) {
this.superUniqueProperty = Parent;
}
// Constructor with nested construction of a chain of prototypes
var Inheritor = inherit.extend(Child, Parent1, Parent2, Parent3, Parent4);
```

Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor

## inherit.decorate

Make a new constructor using every transferred class and/or Object as decorator.
Constructor steel have it own prototype, but have all own props from all decorators.
Can be used as binded Constructor properties.

**Examples**

```javascript
var inherit = require('s-inherit');
var DecoratedClass = inherit.decorate(Cube, {top: 100, left: 100}, {width: 100, heigh: 100, long: 100});
```

Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** constructor

## exports

defination on platforms (both variants on platform like Electron)

bower i --save s-inherit

npm i --save s-inherit

**Examples**

```javascript
window.inherit                      // in browser
```

```javascript
var inherit = require('s-inherit')  // in Node.js
```
