Sha256: 3f1018fdf78b0002cb26492048017f6c11ce16e00c715277fb269d207e85e0ab

Contents?: true

Size: 548 Bytes

Versions: 9

Compression:

Stored size: 548 Bytes

Contents

/**
 * class Scene < Jax.Model
 * 
 */
var Scene = (function() {
  return Jax.Model.create({
    after_initialize: function() {
      /* if this.door exists, it's currently the ID of an actual Door instance. We want the instance itself. */
      /* TODO add some belongs_to/has_many/has_one/etc relationships to handle finding instances automatically */
      if (this.door)
        this.door = Door.find(this.door);
    },
    
    after_added_to_world: function(world) {
      if (this.door)
        world.addObject(this.door);
    }
  });
})();

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jax-0.0.0.9 spec/example_app/app/models/scene.js
jax-0.0.0.8 spec/example_app/app/models/scene.js
jax-0.0.0.7 spec/example_app/app/models/scene.js
jax-0.0.0.6 spec/example_app/app/models/scene.js
jax-0.0.0.5 spec/example_app/app/models/scene.js
jax-0.0.0.4 spec/example_app/app/models/scene.js
jax-0.0.0.3 spec/example_app/app/models/scene.js
jax-0.0.0.2 spec/example_app/app/models/scene.js
jax-0.0.0.1 spec/example_app/app/models/scene.js