Sha256: 309956d871071dc278ac0f75b77e96d2069c3f661516d3fd8116b82779861754

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

package <%= base_package %>.controllers {

	import <%= base_package %>.models.domain.*;

	import mx.core.Application;		
	import org.restfulx.Rx;
	import org.restfulx.controllers.RxApplicationController;
	import org.restfulx.utils.RxUtils;

	public class <%= command_controller_name %> extends RxApplicationController {
		private static var controller:<%= command_controller_name %>;
    
		public static var models:Array = [Account, Address, Content, ContentAssignment]; /* Models */
    
		public static var commands:Array = [<%= command_names %>]; /* Commands */
    
		public function <%= command_controller_name %>(enforcer:SingletonEnforcer, extraServices:Array, defaultServiceId:int = -1) {
			super(commands, models, extraServices, defaultServiceId);
		}
    
		public static function get instance():<%= command_controller_name %> {
			if (controller == null) initialize();
			return controller;
		}
    
		public static function initialize(extraServices:Array = null, defaultServiceId:int = -1, airDatabaseName:String = null):void {
			if (!RxUtils.isEmpty(airDatabaseName)) Rx.airDatabaseName = airDatabaseName;
			controller = new <%= command_controller_name %>(new SingletonEnforcer, extraServices, defaultServiceId);
			Rx.sessionToken = Application.application.parameters.session_token;
			if (Application.application.parameters.authenticity_token) {
				Rx.defaultMetadata = { authenticity_token : Application.application.parameters.authenticity_token };
			}
		}
	}
}

class SingletonEnforcer {}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
emergent-core-0.1.0 rails_generators/emergent_controller/templates/controller.as.erb
emergent-core-0.1.01 rails_generators/emergent_controller/templates/controller.as.erb
emergent-core-0.1.02 rails_generators/emergent_controller/templates/controller.as.erb