Sha256: e0736677efe5eefe2871dfd802347fb42d3b7c4305b402c88decffb7555a8678

Contents?: true

Size: 444 Bytes

Versions: 5

Compression:

Stored size: 444 Bytes

Contents

require 'roo/excelx/extractor'

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

    def to_a
      @relationships ||= extract_relationships
    end

    private

    def extract_relationships
      if doc_exists?
        Hash[doc.xpath("/Relationships/Relationship").map do |rel|
          [rel.attribute('Id').text, rel]
        end]
      else
        []
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
culturecode-roo-2.0.2 lib/roo/excelx/relationships.rb
culturecode-roo-2.0.1 lib/roo/excelx/relationships.rb
roo-2.0.0 lib/roo/excelx/relationships.rb
roo-2.0.0beta1 lib/roo/excelx/relationships.rb
roo-andyw8-2.0.0 lib/roo/excelx/relationships.rb