o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1392321406.634016: @value"õ {I" class:EFI"ProcessedAsset;FI"logical_path;FI"web-app/managed_request.js;TI" pathname;FI"^/Users/nkr/Projetos/Iugu/iugu-ux/vendor/assets/javascripts/web-app/managed_request.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2014-01-14T09:59:34-02:00;FI" length;Fi·I" digest;F"%f1da5332b5fac546e2df6d0596bd2a9bI" source;FI"·(function() { var ManagedRequest; ManagedRequest = (function() { ManagedRequest.prototype.defaults = { type: "GET", url: "", name: "managedRequest" }; ManagedRequest.prototype.parseResponse = function(jqXHR) { var error, obj; obj = {}; obj.responseText = jqXHR.responseText; obj.responseStatus = jqXHR.status; try { obj.data = JSON.parse(jqXHR.responseText); } catch (_error) { error = _error; obj.data = {}; } return obj; }; function ManagedRequest(options) { this.options = _.extend({}, this.defaults, this.options, options); this.requester = Backbone.ajax; if (this.options.ajax) { this.requester = this.options.ajax; } this.trigger = function() { return debug("NO TRIGGER"); }; if (this.options.context && this.options.context.trigger) { this.trigger = this.options.context.trigger; this.trigger = _.bind(this.options.context.trigger, this.options.context); } _.bindAll(this); } ManagedRequest.prototype.execute = function() { return this.requester({ type: this.options.type, url: this.options.url, data: this.options.data, success: this.success, error: this.error, complete: this.complete, dataType: "json", contentType: "application/json", processData: false }); }; ManagedRequest.prototype.success = function(data, textStatus, jqXHR) { if (data.errors) { return this.trigger("" + this.options.name + ":fail", this.parseResponse(jqXHR)); } else { return this.trigger("" + this.options.name + ":done", this.parseResponse(jqXHR)); } }; ManagedRequest.prototype.error = function(jqXHR, textStatus, errorThrown) { return this.trigger("" + this.options.name + ":fail", this.parseResponse(jqXHR)); }; ManagedRequest.prototype.complete = function(jqXHR, textStatus, errorThrown) { return this.trigger("" + this.options.name + ":all", this.parseResponse(jqXHR)); }; return ManagedRequest; })(); this.ManagedRequest = ManagedRequest; }).call(this); ;TI"dependency_digest;F"%e0e81a94105da3bc6d16691790194e03I"required_paths;F[I"^/Users/nkr/Projetos/Iugu/iugu-ux/vendor/assets/javascripts/web-app/managed_request.coffee;TI"dependency_paths;F[{I" path;FI"^/Users/nkr/Projetos/Iugu/iugu-ux/vendor/assets/javascripts/web-app/managed_request.coffee;TI" mtime;FI"2014-01-14T09:59:34-02:00;FI" digest;F"%8d89736396266e549f11bd9f7b92edccI" _version;F"%9f3b95dd7ea3030dc35985c0a8020862