Sha256: b3b7e66af853e0b8693ce4136efbdffa559b010e8bbe5237fdc850d1617ac7fe

Contents?: true

Size: 348 Bytes

Versions: 4

Compression:

Stored size: 348 Bytes

Contents

module ActiveFedora::Aggregation
  class OrderedReader
    include Enumerable
    attr_reader :root
    def initialize(root)
      @root = root
    end

    def each
      proxy = first_head
      while proxy
        yield proxy.target
        proxy = proxy.next
      end
    end

    private

    def first_head
      root.head
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activefedora-aggregation-0.4.2 lib/active_fedora/aggregation/ordered_reader.rb
activefedora-aggregation-0.4.1 lib/active_fedora/aggregation/ordered_reader.rb
activefedora-aggregation-0.4.0 lib/active_fedora/aggregation/ordered_reader.rb
activefedora-aggregation-0.3.0 lib/active_fedora/aggregation/ordered_reader.rb