GODPAPER | All Packages | All Classes | Index | Frames No Frames |
MixinUtil

Package | com.godpaper.as3.utils
Class | public class MixinUtil
Inheritance | MixinUtil Object

That title may be a bit of a stretch, AS3 does not support mixins in the same way as Ruby, but it is possible to define a set of methods and/or attributes in a single file and then mix those methods and attributes into your AS3 classes.

See also

http://flexonrails.net/?p=73

Public Methods

| Method | Defined By
--- | --- | ---
|  | extendClass(c:Class, mixin:Class):void [static] Copies static and instance methods and properties from mixin to c. | MixinUtil
|  | mixinMembers(c:Class, mixin:Class):void [static] Copies instance methods and properties from the mixin's class instance and the mixin's prototype to c's prototype. | MixinUtil
|  | mixinStatics(c:Class, mixin:Class):void [static] Copies static methods and properties from mixin to c. | MixinUtil

Method Detail

extendClass | () | method

`public static function extendClass(c:Class, mixin:Class):void`

Copies static and instance methods and properties from mixin to c.

Parameters

| `c:Class`
| `mixin:Class`

mixinMembers | () | method |

`public static function mixinMembers(c:Class, mixin:Class):void`

Copies instance methods and properties from the mixin's class instance and the mixin's prototype to c's prototype.

Parameters

| `c:Class`
| `mixin:Class`

mixinStatics | () | method |

`public static function mixinStatics(c:Class, mixin:Class):void`

Copies static methods and properties from mixin to c.

Parameters

| `c:Class`
| `mixin:Class`

Thu Jan 16 2014, 01:11 PM +08:00