YUI~oop Class
The following methods are added to the YUI instance
Item Index
Methods
aggregate
-
r
-
s
-
ov
-
wl
Applies object properties from the supplier to the receiver. If the target has the property, and the property is an object, the target object will be augmented with the supplier's value. If the property is an array, the suppliers value will be appended to the target.
Parameters:
-
r
Functionthe object to receive the augmentation.
-
s
Functionthe object that supplies the properties to augment.
-
ov
Booleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wl
Stringa whitelist. If supplied, only properties in this list will be applied to the receiver.
Returns:
aggregate
-
r
-
s
-
ov
-
wl
Applies object properties from the supplier to the receiver. If the target has the property, and the property is an object, the target object will be augmented with the supplier's value. If the property is an array, the suppliers value will be appended to the target.
Parameters:
-
r
Functionthe object to receive the augmentation.
-
s
Functionthe object that supplies the properties to augment.
-
ov
Booleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wl
Stringa whitelist. If supplied, only properties in this list will be applied to the receiver.
Returns:
augment
-
r
-
s
-
ov
-
wl
-
args
Applies prototype properties from the supplier to the receiver. The receiver can be a constructor or an instance.
Parameters:
-
r
Functionthe object to receive the augmentation.
-
s
Functionthe object that supplies the properties to augment.
-
ov
Booleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wl
Stringa whitelist. If supplied, only properties in this list will be applied to the receiver.
-
args
Array | Anyarg or arguments to apply to the supplier constructor when initializing.
Returns:
augment
-
r
-
s
-
ov
-
wl
-
args
Applies prototype properties from the supplier to the receiver. The receiver can be a constructor or an instance.
Parameters:
-
r
Functionthe object to receive the augmentation.
-
s
Functionthe object that supplies the properties to augment.
-
ov
Booleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wl
Stringa whitelist. If supplied, only properties in this list will be applied to the receiver.
-
args
Array | Anyarg or arguments to apply to the supplier constructor when initializing.
Returns:
bind
-
f
-
c
-
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the beginning of the arguments collection the supplied to the function.
Parameters:
-
f
Function | Stringthe function to bind, or a function name to execute on the context object.
-
c
Objectthe execution context.
-
args
Any multiple0..n arguments to include before the arguments the function is executed with.
Returns:
bind
-
f
-
c
-
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the beginning of the arguments collection the supplied to the function.
Parameters:
-
f
Function | Stringthe function to bind, or a function name to execute on the context object.
-
c
Objectthe execution context.
-
args
Any multiple0..n arguments to include before the arguments the function is executed with.
Returns:
clone
-
o
-
safe
-
f
-
c
-
owner
-
cloned
Deep obj/array copy. Function clones are actually wrappers around the original function. Array-like objects are treated as arrays. Primitives are returned untouched. Optionally, a function can be provided to handle other data types, filter keys, validate values, etc.
Parameters:
-
o
Objectwhat to clone.
-
safe
Booleanif true, objects will not have prototype items from the source. If false, they will. In this case, the original is initially protected, but the clone is not completely immune from changes to the source object prototype. Also, cloned prototype items that are deleted from the clone will result in the value of the source prototype being exposed. If operating on a non-safe clone, items should be nulled out rather than deleted.
-
f
Functionoptional function to apply to each item in a collection; it will be executed prior to applying the value to the new object. Return false to prevent the copy.
-
c
Objectoptional execution context for f.
-
owner
ObjectOwner object passed when clone is iterating an object. Used to set up context for cloned functions.
-
cloned
Objecthash of previously cloned objects to avoid multiple clones.
Returns:
clone
-
o
-
safe
-
f
-
c
-
owner
-
cloned
Deep obj/array copy. Function clones are actually wrappers around the original function. Array-like objects are treated as arrays. Primitives are returned untouched. Optionally, a function can be provided to handle other data types, filter keys, validate values, etc.
Parameters:
-
o
Objectwhat to clone.
-
safe
Booleanif true, objects will not have prototype items from the source. If false, they will. In this case, the original is initially protected, but the clone is not completely immune from changes to the source object prototype. Also, cloned prototype items that are deleted from the clone will result in the value of the source prototype being exposed. If operating on a non-safe clone, items should be nulled out rather than deleted.
-
f
Functionoptional function to apply to each item in a collection; it will be executed prior to applying the value to the new object. Return false to prevent the copy.
-
c
Objectoptional execution context for f.
-
owner
ObjectOwner object passed when clone is iterating an object. Used to set up context for cloned functions.
-
cloned
Objecthash of previously cloned objects to avoid multiple clones.
Returns:
each
-
o
-
f
-
c
-
proto
Executes the supplied function for each item in a collection. Supports arrays, objects, and Y.NodeLists
Parameters:
-
o
Objectthe object to iterate.
-
f
Functionthe function to execute. This function receives the value, key, and object as parameters.
-
c
Objectthe execution context for the function.
-
proto
Booleanif true, prototype properties are iterated on objects.
Returns:
each
-
o
-
f
-
c
-
proto
Executes the supplied function for each item in a collection. Supports arrays, objects, and Y.NodeLists
Parameters:
-
o
Objectthe object to iterate.
-
f
Functionthe function to execute. This function receives the value, key, and object as parameters.
-
c
Objectthe execution context for the function.
-
proto
Booleanif true, prototype properties are iterated on objects.
Returns:
extend
-
r
-
s
-
px
-
sx
Utility to set up the prototype, constructor and superclass properties to support an inheritance strategy that can chain constructors and methods. Static members will not be inherited.
Parameters:
-
r
Functionthe object to modify.
-
s
Functionthe object to inherit.
-
px
Objectprototype properties to add/override.
-
sx
Objectstatic properties to add/override.
Returns:
extend
-
r
-
s
-
px
-
sx
Utility to set up the prototype, constructor and superclass properties to support an inheritance strategy that can chain constructors and methods. Static members will not be inherited.
Parameters:
-
r
Functionthe object to modify.
-
s
Functionthe object to inherit.
-
px
Objectprototype properties to add/override.
-
sx
Objectstatic properties to add/override.
Returns:
rbind
-
f
-
c
-
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the end of the arguments the function is executed with.
Parameters:
-
f
Function | Stringthe function to bind, or a function name to execute on the context object.
-
c
Objectthe execution context.
-
args
Any multiple0..n arguments to append to the end of arguments collection supplied to the function.
Returns:
rbind
-
f
-
c
-
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the end of the arguments the function is executed with.
Parameters:
-
f
Function | Stringthe function to bind, or a function name to execute on the context object.
-
c
Objectthe execution context.
-
args
Any multiple0..n arguments to append to the end of arguments collection supplied to the function.
Returns:
some
-
o
-
f
-
c
-
proto
Executes the supplied function for each item in a collection. The operation stops if the function returns true. Supports arrays, objects, and Y.NodeLists.
Parameters:
-
o
Objectthe object to iterate.
-
f
Functionthe function to execute. This function receives the value, key, and object as parameters.
-
c
Objectthe execution context for the function.
-
proto
Booleanif true, prototype properties are iterated on objects.
Returns:
some
-
o
-
f
-
c
-
proto
Executes the supplied function for each item in a collection. The operation stops if the function returns true. Supports arrays, objects, and Y.NodeLists.
Parameters:
-
o
Objectthe object to iterate.
-
f
Functionthe function to execute. This function receives the value, key, and object as parameters.
-
c
Objectthe execution context for the function.
-
proto
Booleanif true, prototype properties are iterated on objects.