rb-appscript

3. Packing and unpacking data

Codecs

The AEM::Codecs class provides methods for converting Ruby data to AE::AEDesc objects, and vice-versa.

Codecs

    Constructor:
        new

    Methods:

        pack(data) -- convert Ruby data to an AEDesc; will raise
                a TypeError if data's type/class is unsupported
            data : anything
            Result : AEDesc

        unpack(desc) -- convert an AEDesc to Ruby data; will return
                the AEDesc unchanged if it's an unsupported type
            desc : AEDesc
            Result : anything

        add_unit_types(types) -- register custom unit type definitions
            types : list -- a list of lists, where each sublist is of form
                    [name, code] or [name, code, pack_proc, unpack_proc]

AE types

The Apple Event Manager defines several types for representing type/class names, enumerator names, etc. that have no direct equivalent in Ruby. Accordingly, aem defines several classes to represent these types on the Ruby side. All share a common abstract base class, AETypeBase:

AETypeBase -- Abstract base class

    Constructor:
        new(code)
            code : str -- a four-character Apple event code

    Methods:
        code
            Result : str -- the four-character code


AEType < AETypeBase -- represents an AE object of typeType


AEEnum < AETypeBase -- represents an AE object of typeEnumeration


AEProp < AETypeBase -- represents an AE object of typeProperty


AEKey < AETypeBase -- represents an AE object of typeKeyword