(function() {
  var __hasProp = Object.prototype.hasOwnProperty, __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (__hasProp.call(this, i) && this[i] === item) return i; } return -1; };

  this.def_class('Rome',DObject,function(__scope,__class){

    if(!this.__ctor__){this.__ctor__= function Rome(){}; this.__ctor__.prototype = this.prototype; }

    this.def_class('Struct',DObject,function(__scope,__class){

      if(!this.__ctor__){this.__ctor__= function Struct(){}; this.__ctor__.prototype = this.prototype; }

      this.repository = function() {
        return __scope.Rome.repository();
      };__singleton_method_added(this,"repository");

      this.prototype.repository = function() {
        return __scope.Rome.repository();
      }; __method_added(this,"repository");

      this.prototype["ready?"] = function() {
        return __indexOf.call($READY, this["@state"]) >= 0;
      }; __method_added(this,"ready?");

      this.prototype["ready!"] = function() {
        var _this = this;
        this["@state"] = $READY_CLEAN;
        this["@onready"] && this["@onready"].each(function() {
          return arguments[0](_this);
        });
        this["@onready"] = nil;
        return this;
      }; __method_added(this,"ready!");

      this.prototype.onready = function(blk) {
        if (this["ready?"]()) return blk(this);
        this["@onready"] || (this["@onready"] = []);
        this["@onready"].push(blk);
        return this;
      }; __method_added(this,"onready");

    });

  });

}).call($$base);

