ModuleReference source

Specializes Montage

Properties

id :string <constructor> source

The absolute id of the module within the require package

ModuleReference <constructor> source

require :function <constructor> source

The require of a package.

Methods

resolve(otherRequire) → {string} <constructor> source

Resolves this module reference so that it can be required from otherRequire.

Parameters:
Name Type Description
otherRequire function

Require from another package that has the package of this module as a dependency.

Throws:
If there is no mapping from this require inside otherRequire.
Type
Error
Returns: string

The module id to pass to otherRequire that results in this module.

Examples
var ref = new ModuleReference().initWithIdAndRequire("core/uuid", montageRequire);
ref.resolve(applicationRequire); // => "montage/core/uuid"
var ref = new ModuleReference().initWithIdAndRequire("ui/main.reel", applicationRequire);
ref.resolve(montageRequire); // => Error
// because there is no module id such that montageRequire(id) can
// return the module from inside your application

callDelegateMethod(name) source

This method calls the method named with the identifier prefix if it exists. Example: If the name parameter is "shouldDoSomething" and the caller's identifier is "bob", then this method will try and call "bobShouldDoSomething"

Parameters:
Name Type Description
name string
Inherited From:

equals(anObject) → {boolean} source

Returns true if two objects are equal, otherwise returns false.

Parameters:
Name Type Description
anObject Object

The object to compare for equality.

Inherited From:
Returns: boolean

Returns true if the calling object and anObject are identical and their uuid properties are also equal. Otherwise, returns false.

Generated from a4679af

ModuleReference source

Specializes Value

Properties

id :string <constructor> source

The absolute id of the module within the require package

ModuleReference <constructor> source

require :function <constructor> source

The require of a package.

Methods

resolve(otherRequire) → {string} <constructor> source

Resolves this module reference so that it can be required from otherRequire.

Parameters:
Name Type Description
otherRequire function

Require from another package that has the package of this module as a dependency.

Throws:
If there is no mapping from this require inside otherRequire.
Type
Error
Returns: string

The module id to pass to otherRequire that results in this module.

Examples
var ref = new ModuleReference().initWithIdAndRequire("core/uuid", montageRequire);
ref.resolve(applicationRequire); // => "montage/core/uuid"
var ref = new ModuleReference().initWithIdAndRequire("ui/main.reel", applicationRequire);
ref.resolve(montageRequire); // => Error
// because there is no module id such that montageRequire(id) can
// return the module from inside your application

callDelegateMethod(name) source

This method calls the method named with the identifier prefix if it exists. Example: If the name parameter is "shouldDoSomething" and the caller's identifier is "bob", then this method will try and call "bobShouldDoSomething"

Parameters:
Name Type Description
name string
Inherited From:

equals(anObject) → {boolean} source

Returns true if two objects are equal, otherwise returns false.

Parameters:
Name Type Description
anObject Object

The object to compare for equality.

Inherited From:
Returns: boolean

Returns true if the calling object and anObject are identical and their uuid properties are also equal. Otherwise, returns false.

Generated from a4679af

comments powered by Disqus

More help?

Can't find what you are looking for? Get in touch, we're more than happy in helping answer your questions.