(function() {
  var lazy;

  lazy = function(klass, name, callback) {
    var cache;
    cache = name + 'Cache';
    return klass.prototype[name] = function() {
      if (this[cache] != null) {
        return this[cache];
      } else {
        return this[cache] = callback.apply(this, arguments);
      }
    };
  };

  module.exports = lazy;

}).call(this);
