Sha256: 182b14abb7c484ce221cfe60404aa26407aeaada6832a6007114d5bc285ee010

Contents?: true

Size: 665 Bytes

Versions: 1

Compression:

Stored size: 665 Bytes

Contents

(function() {

  if (typeof Spine === "undefined" || Spine === null) Spine = require('spine');

  Spine.Model.Local = {
    extended: function() {
      this.change(this.saveLocal);
      return this.fetch(this.loadLocal);
    },
    saveLocal: function() {
      var result;
      result = JSON.stringify(this);
      return localStorage[this.className] = result;
    },
    loadLocal: function() {
      var result;
      result = localStorage[this.className];
      return this.refresh(result || [], {
        clear: true
      });
    }
  };

  if (typeof module !== "undefined" && module !== null) {
    module.exports = Spine.Model.Local;
  }

}).call(this);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spine-rails-0.1.0 app/assets/javascripts/spine/local.js