Sha256: 36c2b57cd46938a538df6d4f7f1881fb2e3d6ade484c3ba6163cd13c213f4df1
Contents?: true
Size: 671 Bytes
Versions: 7
Compression:
Stored size: 671 Bytes
Contents
# frozen_string_literal: true module Valkyrie::Persistence::Fedora # Lazily iterates over a doubly linked list, fixing up nodes if necessary. # Used for reading ordered members out of Fedora, and then converting them to # member_ids. 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&.prev != proxy proxy = next_proxy end end private def first_head root.head end end end
Version data entries
7 entries across 7 versions & 1 rubygems