Skip to content

Instantly share code, notes, and snippets.

@zegomesjf
Forked from gufranco-zz/FooBar.js
Created June 27, 2013 13:02
Show Gist options
  • Save zegomesjf/5876204 to your computer and use it in GitHub Desktop.
Save zegomesjf/5876204 to your computer and use it in GitHub Desktop.
;var FooBar = (function($, window, document, undefined) {
'use strict';
/**
* Constructor method
*
* @author Gustavo Franco
* @since 2013-06-27
*/
function FooBar() {
try {
console.log('constructor');
} catch (exception) {
console.error(exception);
}
}
/**
* Foo method
*
* @author Gustavo Franco
* @since 2013-06-27
*/
FooBar.prototype.foo = function() {
try {
console.log('foo');
} catch (exception) {
console.error(exception);
}
};
/**
* Bar method
*
* @author Gustavo Franco
* @since 2013-06-27
*/
FooBar.prototype.bar = function() {
try {
console.log('bar');
} catch (exception) {
console.error(exception);
}
};
return FooBar;
})(jQuery, window, document);
var fooBar = new FooBar(); // constructor
fooBar.foo(); // foo
fooBar.bar(); // bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment