diff options
| author | Ben Beltran <ben@nsovocal.com> | 2014-08-12 19:25:52 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2014-08-12 19:25:52 -0500 |
| commit | 60a6915a0b24975e28a02b28e43d34f6dbb15625 (patch) | |
| tree | ccf114757150425e9ab3e4587f09cd1795567d27 /lib | |
| parent | a2949b6a6621627d0382fd1702d067b7b82322ed (diff) | |
Components extend without having to define initv0.1.6
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/serpentity/component.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/serpentity/component.js b/lib/serpentity/component.js index 0204e30..0018a88 100644 --- a/lib/serpentity/component.js +++ b/lib/serpentity/component.js @@ -5,5 +5,17 @@ * components can be any class whatsoever. */ Class(Serpentity, "Component")({ + prototype : { + init : function init(config) { + var property; + config = config || {}; + + for (property in config) { + if (config.hasOwnProperty(property)) { + this[property] = config[property]; + } + } + } + } }); |