src/model.js
function(paths) {
		var self = this;

		if (typeof paths === "string") paths = parse(paths, { startRule: "pathQuery" });
		if (!_.isArray(paths)) paths = paths != null ? [ paths ] : [];
		
		if (!paths.length) {
			var model = this.findModel(function(m) { return !_.isUndefined(m.data); });
			if (model == null) return;
			var val = model.data;
			if (_.isFunction(val)) val = val.call(this, null);
			return val;
		}

		return _.reduce(paths, function(result, path, index) {
			var model = self,
				scope = true,
				val;

			if (path.type === "root") {
				model = self.getRootModel();
			} else if (path.type === "parent") {
				model = self.getModelAtOffset(path.distance);
				scope = false;
			} else if (path.type === "all") {
				scope = false;
			}

			if (model == null) return;

			while (_.isUndefined(val) && model != null) {
				val = model.getLocal(path);
				model = model.parent;
				if (scope) break;
			}

			if (_.isFunction(val)) {
				val = val.call(self, index === 0 ? null : result);
			}

			return val;
		}, void 0);
	}
function(paths) {
		var self = this;

		if (typeof paths === "string") paths = parse(paths, { startRule: "pathQuery" });
		if (!_.isArray(paths)) paths = paths != null ? [ paths ] : [];
		
		if (!paths.length) {
			var model = this.findModel(function(m) { return !_.isUndefined(m.data); });
			if (model == null) return;
			var val = model.data;
			if (_.isFunction(val)) val = val.call(this, null);
			return val;
		}

		return _.reduce(paths, function(result, path, index) {
			var model = self,
				scope = true,
				val;

			if (path.type === "root") {
				model = self.getRootModel();
			} else if (path.type === "parent") {
				model = self.getModelAtOffset(path.distance);
				scope = false;
			} else if (path.type === "all") {
				scope = false;
			}

			if (model == null) return;

			while (_.isUndefined(val) && model != null) {
				val = model.getLocal(path);
				model = model.parent;
				if (scope) break;
			}

			if (_.isFunction(val)) {
				val = val.call(self, index === 0 ? null : result);
			}

			return val;
		}, void 0);
	}
function ( paths ) { var self = this ; if ( typeof paths === "string" ) paths = parse ( paths , { startRule : "pathQuery" } ) ; if ( ! _ . isArray ( paths ) ) paths = paths != null ? [ paths ] : [ ] ; if ( ! paths . length ) { var model = this . findModel ( function ( m ) { return ! _ . isUndefined ( m . data ) ; } ) ; if ( model == null ) return ; var val = model . data ; if ( _ . isFunction ( val ) ) val = val . call ( this , null ) ; return val ; } return _ . reduce ( paths , function ( result , path , index ) { var model = self , scope = true , val ; if ( path . type === "root" ) { model = self . getRootModel ( ) ; } else if ( path . type === "parent" ) { model = self . getModelAtOffset ( path . distance ) ; scope = false ; } else if ( path . type === "all" ) { scope = false ; } if ( model == null ) return ; while ( _ . isUndefined ( val ) && model != null ) { val = model . getLocal ( path ) ; model = model . parent ; if ( scope ) break ; } if ( _ . isFunction ( val ) ) { val = val . call ( self , index === 0 ? null : result ) ; } return val ; } , void 0 ) ; }
retrieves value with path query
retrieves value with path query