Add Basestar class for use in external modules

This commit is contained in:
Andrew Stewart 2013-10-29 10:43:11 -07:00
parent 504e51bd28
commit 1c3d2236a0
4 changed files with 62 additions and 0 deletions

36
dist/basestar.js vendored Normal file
View File

@ -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);

2
dist/robot.js vendored
View File

@ -14,6 +14,8 @@
require('./cylon');
require('./basestar');
Connection = require("./connection");
Device = require("./device");

23
src/basestar.coffee Normal file
View File

@ -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)

View File

@ -9,6 +9,7 @@
'use strict';
require('./cylon')
require('./basestar')
Connection = require("./connection")
Device = require("./device")
Async = require("async")