Sha256: c491af10919ce81da0586a19f33bb3b59498b9b44a680cb8b189064aec552d06

Contents?: true

Size: 470 Bytes

Versions: 2

Compression:

Stored size: 470 Bytes

Contents

require 'roo/excelx/extractor'

module Roo
  class Excelx
    class Relationships < Excelx::Extractor
      def [](index)
        to_a[index]
      end

      def to_a
        @relationships ||= extract_relationships
      end

      private

      def extract_relationships
        return [] unless doc_exists?

        doc.xpath('/Relationships/Relationship').each_with_object({}) do |rel, hash|
          hash[rel['Id']] = rel
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roo-2.8.1 lib/roo/excelx/relationships.rb
roo-2.8.0 lib/roo/excelx/relationships.rb