class Xcodeproj::Project::ObjectList
@todo Cover all the mutations methods of the {Array} class.
usually are implemented in C
Moreover it is a moving target because the methods of array
the array methods should be covered, but this is not done yet.
which are overridden to inform objects reference count. Ideally all
@note Concerning the mutations methods it is safe to call only those
with reference count on modifications.
the project is not serialized with unreachable objects by updating the
It works in conjunction with the {AbstractObject} class to ensure that
This class represents an ordered relationship to many objects.
def +(other)
-
(void)-
Parameters:
-
objects(Array) --
def +(other) perform_additions_operations(other) super end
def <<(object)
-
(void)-
Parameters:
-
object(AbstractObject, ObjectDictionary) --
def <<(object) perform_additions_operations(object) super end
def clear
-
(void)-
def clear objects.each do |object| perform_deletion_operations(object) end super end
def delete(object)
-
(AbstractObject, ObjectDictionary, Nil)- the object if found.
Parameters:
-
object(AbstractObject, ObjectDictionary) --
def delete(object) perform_deletion_operations(object) super end
def delete_at(index)
-
(AbstractObject, ObjectDictionary, Nil)- the object if found.
Parameters:
-
from(Fixnum) --
def delete_at(index) object = at(index) perform_deletion_operations(object) super end
def initialize(attribute, owner)
synthesized methods generated by {AbstractObject.has_many}.
{ObjectList}, it is always initialized empty and automatically by the
{Xcodeproj} clients are not expected to create instances of
def initialize(attribute, owner) @attribute = attribute @owner = owner end
def insert(index, object)
-
(void)-
Parameters:
-
object(AbstractObject, ObjectDictionary) --
def insert(index, object) perform_additions_operations(object) super end
def move(object, new_index)
-
(void)-
Parameters:
-
to(Fixnum) -- -
from(Fixnum) --
def move(object, new_index) if obj = delete(object) insert(new_index, obj) else raise "Attempt to move object `#{object}` not present in the list `#{inspect}`" end end
def move_from(current_index, new_index)
-
(void)-
Parameters:
-
to(Fixnum) -- -
from(Fixnum) --
def move_from(current_index, new_index) if obj = delete_at(current_index) insert(new_index, obj) else raise "Attempt to move object from index `#{current_index}` which is beyond bounds of the list `#{inspect}`" end end
def objects
-
(Array-)
def objects to_a end
def perform_additions_operations(objects)
-
(void)-
def perform_additions_operations(objects) objects = [objects] unless objects.is_a?(Array) objects.each do |obj| obj.add_referrer(owner) attribute.validate_value(obj) unless obj.is_a?(ObjectDictionary) end end
def perform_deletion_operations(objects)
-
(void)-
def perform_deletion_operations(objects) objects = [objects] unless objects.is_a?(Array) objects.each do |obj| obj.remove_referrer(owner) unless obj.is_a?(ObjectDictionary) end end
def unshift(object)
-
(void)-
Parameters:
-
object(AbstractObject, ObjectDictionary) --
def unshift(object) perform_additions_operations(object) super end
def uuids
-
(Array-)
def uuids map(&:uuid) end