Add Basestar class for use in external modules
This commit is contained in:
parent
504e51bd28
commit
1c3d2236a0
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* basestar
|
||||
* cylonjs.com
|
||||
*
|
||||
* Copyright (c) 2013 The Hybrid Group
|
||||
* Licensed under the Apache 2.0 license.
|
||||
*/
|
||||
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
var namespace;
|
||||
|
||||
namespace = require('node-namespace');
|
||||
|
||||
require('./utils');
|
||||
|
||||
namespace('Cylon', function() {
|
||||
return this.Basestar = (function() {
|
||||
function Basestar(opts) {
|
||||
this.self = this;
|
||||
}
|
||||
|
||||
Basestar.prototype.proxyMethods = function(methods, target, klass, force) {
|
||||
if (force == null) {
|
||||
force = false;
|
||||
}
|
||||
return proxyFunctionsToObject(methods, target, klass, force);
|
||||
};
|
||||
|
||||
return Basestar;
|
||||
|
||||
})();
|
||||
});
|
||||
|
||||
}).call(this);
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
require('./cylon');
|
||||
|
||||
require('./basestar');
|
||||
|
||||
Connection = require("./connection");
|
||||
|
||||
Device = require("./device");
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
###
|
||||
* basestar
|
||||
* cylonjs.com
|
||||
*
|
||||
* Copyright (c) 2013 The Hybrid Group
|
||||
* Licensed under the Apache 2.0 license.
|
||||
###
|
||||
|
||||
'use strict';
|
||||
|
||||
namespace = require 'node-namespace'
|
||||
require './utils'
|
||||
|
||||
# Basestar is the class used when writing external Cylon adaptors/drivers.
|
||||
#
|
||||
# It provides some useful methods and behaviour.
|
||||
namespace 'Cylon', ->
|
||||
class @Basestar
|
||||
constructor: (opts) ->
|
||||
@self = this
|
||||
|
||||
proxyMethods: (methods, target, klass, force = false) ->
|
||||
proxyFunctionsToObject(methods, target, klass, force)
|
|
@ -9,6 +9,7 @@
|
|||
'use strict';
|
||||
|
||||
require('./cylon')
|
||||
require('./basestar')
|
||||
Connection = require("./connection")
|
||||
Device = require("./device")
|
||||
Async = require("async")
|
||||
|
|
Loading…
Reference in New Issue