|
| |||||||||||||||||||
_subject
If new_object argument is given, then the copy starts with new_object
which will merge the fields of _subject into new_object
If subject is a primitive value (string, number, boolean, char, null), just return it.
include is a method that is called for each field key that may be copied.
If include returns true, the field is included in the copy, otherwise it isn't.
Copy uses two attributes to determine how many ancestors to go up from _subject
and grab field values from.
limit is an object that is presumably an ancestor that sets the limit of how
far up copy will go looking for fields.
If include_limit is true include the fields of the limit object,
otherwise don't, only include fields below the limit object.
Never are fields above the limit considered for copying.
Only the value of the first field of a given key that is found on the way up
is used in the copy.
By default, include is return_true limit is _subject and
include_limit is true which means that
all the fields immediately in _subject are copied and no more.
If additional named arguments are passed to copy, those fields are added to the
result. If an additional arg has the same name as a field in the original,
then the passed in value will override the original's value for the field.
© Copyright 2007 Clear Methods, Inc.