Skip to content

Commit

Permalink
Merge pull request #193 from webispy/master
Browse files Browse the repository at this point in the history
Add return self to service_interface
  • Loading branch information
Shouqun authored Aug 2, 2018
2 parents c700929 + d78f0f1 commit 7c87b54
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/service_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ ServiceInterface.prototype.addMethod = function(method, opts, handler) {
}

self.methods[method] = methodObj;

return self;
};

ServiceInterface.prototype.addProperty = function(propName, opts) {
Expand All @@ -58,6 +60,8 @@ ServiceInterface.prototype.addProperty = function(propName, opts) {
}

self.properties[propName] = propObj;

return self;
};

ServiceInterface.prototype.addSignal = function(signalName, opts) {
Expand All @@ -72,6 +76,8 @@ ServiceInterface.prototype.addSignal = function(signalName, opts) {
var args = [ signalName ].concat(Array.prototype.slice.call(arguments));
self.emitSignal.apply(this, args);
});

return self;
};

ServiceInterface.prototype.call = function(method, message, args) {
Expand Down Expand Up @@ -200,6 +206,8 @@ ServiceInterface.prototype.emitSignal = function() {
}

self.object.service.bus._dbus.emitSignal(conn, objPath, interfaceName, signalName, args, signatures);

return self;
};

ServiceInterface.prototype.update = function() {
Expand Down Expand Up @@ -264,4 +272,6 @@ ServiceInterface.prototype.update = function() {
introspection.push('</interface>');

self.introspection = introspection.join('\n');

return self;
};

0 comments on commit 7c87b54

Please sign in to comment.