Sha256: 164d705a8ecb5fefd4ecc695f2ceb3d8b5c408d36174815f6e533fa878e40348
Contents?: true
Size: 559 Bytes
Versions: 69
Compression:
Stored size: 559 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 next_proxy.try(:prev=, proxy) if next_proxy && next_proxy.prev != proxy proxy = next_proxy end end private def first_head root.head end end end
Version data entries
69 entries across 69 versions & 1 rubygems