IrcEventBinder refactor
authorDarren <darren@darrenwhitlen.com>
Fri, 25 Jan 2013 19:06:22 +0000 (19:06 +0000)
committerDarren <darren@darrenwhitlen.com>
Thu, 31 Jan 2013 14:58:43 +0000 (14:58 +0000)
server/irc/eventbinder.js

index 0f4fe8d3b87a67aa25acd3e37907f24337c9d8e6..f3439136870c9ff48a0464fb6ed1a4ca090f367f 100644 (file)
@@ -1,12 +1,7 @@
 var _ = require('lodash');
 
-var IrcEventBinder = function () {};
 
-module.exports = IrcEvents;
-
-
-
-IrcEvents.prototype.bindIrcEvents = function (events_scope, event_map, context, irc_connection) {
+module.exports.bindIrcEvents = function (events_scope, event_map, context, irc_connection) {
     _.each(event_map, function (fn, event_name) {
         // Bind the event to `context`, storing it with the event listing
         if (!event_map[event_name].bound_fn) {
@@ -19,7 +14,7 @@ IrcEvents.prototype.bindIrcEvents = function (events_scope, event_map, context,
 };
 
 
-IrcEvents.prototype.unbindIrcEvents = function (events_scope, event_map, irc_connection) {
+module.exports.unbindIrcEvents = function (events_scope, event_map, irc_connection) {
     _.each(event_map, function(fn, event_name) {
         if (event_map[event_name].bound_fn) {
             // Remove the listener from the IRC connection object