Class: ActiveFedora::Aggregation::ProxyOwner
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ActiveFedora::Aggregation::ProxyOwner
- Defined in:
- lib/active_fedora/aggregation/proxy_owner.rb
Overview
Decorates a proxy owner such that it knows how to delete a proxy from its ordered list.
Instance Method Summary collapse
Instance Method Details
#delete_proxy!(proxy) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/active_fedora/aggregation/proxy_owner.rb', line 11 def delete_proxy!(proxy) if proxy == head || head.nil? # Head is nil if proxy is now deleted. self.head = proxy.next end if proxy == tail || tail.nil? # Head is nil if proxy is now deleted. self.tail = proxy.prev end [head, tail].uniq.compact.each(&:reload) if changed? save! end end |
#is_a?(klass) ⇒ Boolean
6 7 8 |
# File 'lib/active_fedora/aggregation/proxy_owner.rb', line 6 def is_a?(klass) __getobj__.is_a?(klass) end |