aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2014-08-12 19:25:52 -0500
committerBen Beltran <ben@nsovocal.com>2014-08-12 19:25:52 -0500
commit60a6915a0b24975e28a02b28e43d34f6dbb15625 (patch)
treeccf114757150425e9ab3e4587f09cd1795567d27 /lib
parenta2949b6a6621627d0382fd1702d067b7b82322ed (diff)
Components extend without having to define initv0.1.6
Diffstat (limited to 'lib')
-rw-r--r--lib/serpentity/component.js12
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];
+ }
+ }
+ }
+ }
});