class ActiveFedora::Orders::TargetProxy
Attributes
association[R]
Public Class Methods
new(association)
click to toggle source
# File lib/active_fedora/orders/target_proxy.rb, line 6 def initialize(association) @association = association end
Public Instance Methods
<<(obj)
click to toggle source
# File lib/active_fedora/orders/target_proxy.rb, line 10 def <<(obj) association.append_target(obj) self end
==(other_obj)
click to toggle source
Calls superclass method
# File lib/active_fedora/orders/target_proxy.rb, line 54 def ==(other_obj) case other_obj when TargetProxy super when Array to_a == other_obj end end
clear()
click to toggle source
# File lib/active_fedora/orders/target_proxy.rb, line 43 def clear while to_ary.present? association.delete_at(0) end end
concat(objs)
click to toggle source
# File lib/active_fedora/orders/target_proxy.rb, line 15 def concat(objs) objs.each do |obj| self.<<(obj) end self end
delete(obj)
click to toggle source
Deletes all items from self that are equal to obj. @param obj the object to remove from the list @return the last deleted item, or nil if no matching item is found
# File lib/active_fedora/orders/target_proxy.rb, line 39 def delete(obj) association.delete_target(obj) end
delete_at(loc)
click to toggle source
Deletes the element at the specified index, returning that element, or nil if the index is out of range.
# File lib/active_fedora/orders/target_proxy.rb, line 29 def delete_at(loc) result = association.delete_at(loc) if result result.target end end
insert_at(loc, record)
click to toggle source
# File lib/active_fedora/orders/target_proxy.rb, line 22 def insert_at(loc, record) association.insert_target_at(loc, record) self end
to_ary()
click to toggle source
# File lib/active_fedora/orders/target_proxy.rb, line 49 def to_ary association.reader.map(&:target).dup end
Also aliased as: to_a