1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-03 21:07:07 +01:00

Move verb.js to /verbs folder.

This commit is contained in:
hacksalot
2016-01-10 19:08:29 -05:00
parent 65c7e41c53
commit 1416f57d0b
6 changed files with 5 additions and 5 deletions

View File

@ -1,52 +0,0 @@
/**
Definition of the Verb class.
@module verb.js
@license MIT. See LICENSE.md for details.
*/
(function(){
// Use J. Resig's nifty class implementation
var Class = require( '../utils/class' )
, EVENTS = require('events');
/**
An instantiation of a HackMyResume command.
@class Verb
*/
var Verb = module.exports = Class.extend({
init: function( moniker ) {
this.moniker = moniker;
this.emitter = new EVENTS.EventEmitter();
},
on: function() {
this.emitter.on.apply( this.emitter, arguments );
},
fire: function(evtName, payload) {
payload = payload || { };
payload.cmd = this.moniker;
this.emitter.emit( 'hmr:' + evtName, payload );
return true;
},
stat: function( subEvent, payload ) {
payload = payload || { };
payload.cmd = this.moniker;
payload.sub = subEvent;
this.emitter.emit( 'hmr:status', payload );
return true;
}
});
}());