Sha256: 9b403c1ab46a5107b6c627090d8ddc14543f025cadc4989fb5672d44ac6107a9

Contents?: true

Size: 1.55 KB

Versions: 3

Compression:

Stored size: 1.55 KB

Contents

package com.fourD.core
{
	import mx.utils.ObjectUtil;
	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;
	
	public class TectonUtils
	{
		public function TectonUtils()
		{
		}
		
		public static function clone(object:Object):Object {
			if (object is Tecton) {
				var fqn:String = getQualifiedClassName(object);
				var clazz:Class = getDefinitionByName(fqn) as Class;
				var cloned:Object = new clazz;
				cloned["tropon"] = object["tropon"];
				cloned["actions"] = object["actions"];
				cloned["actionParams"] = object["actionParams"];
				cloned["kanon"] = object["kanon"];
				cloned["tropons"] = object["tropons"];
				cloned["name"] = object["name"];
				cloned["actionName"] = object["actionName"];
				cloned["conditions"] = object["conditions"];
				cloned["receptors"] = object["receptors"];
				cloned["initialize"] = object["initialize"];
				cloned["start"] = object["start"];
				cloned["complete"] = object["complete"];
				cloned["isInitialized"] = object["isInitialized"];
				cloned["isRunning"] = object["isRunning"];
				cloned["isComplete"] = object["isComplete"];
				cloned["isActive"] = object["isActive"];
			/*	for each (var node:XML in describeType(object)..accessor) {
					if (!isInvalidPropertyName(node.@name) && !RxUtils.isIgnored(node)) {
						try {
							var name:String = node.@name;
							cloned[name] = object[name];
						} catch (e:Error) {
							// we can fail cloning if the property is read-only, etc.
						}
					}
				}	*/
				return cloned;
			} else {
				return ObjectUtil.copy(object);
			}
		}

	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
emergent-core-0.1.0 rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonUtils.as
emergent-core-0.1.01 rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonUtils.as
emergent-core-0.1.02 rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonUtils.as