Sha256: 9be5913646cac799c6b8a1a93327db0afc32c340204f7ccc44446b9cda75d9fd
Contents?: true
Size: 575 Bytes
Versions: 7
Compression:
Stored size: 575 Bytes
Contents
module ActiveFedora::Aggregation ## # Lazily iterates over a doubly linked list, fixing up nodes if necessary. class OrderedReader include Enumerable attr_reader :root def initialize(root) @root = root end def each proxy = first_head while proxy yield proxy unless proxy.nil? next_proxy = proxy.next if next_proxy && next_proxy.prev != proxy next_proxy.try(:prev=, proxy) end proxy = next_proxy end end private def first_head root.head end end end
Version data entries
7 entries across 7 versions & 1 rubygems