class Roo::Excelx::Relationships

Public Instance Methods

[](index) click to toggle source
# File lib/roo/excelx/relationships.rb, line 8
def [](index)
  to_a[index]
end
include_type?(type) click to toggle source
# File lib/roo/excelx/relationships.rb, line 16
def include_type?(type)
  to_a.any? do |_, rel|
    rel["Type"]&.include? type
  end
end
to_a() click to toggle source
# File lib/roo/excelx/relationships.rb, line 12
def to_a
  @relationships ||= extract_relationships
end

Private Instance Methods

extract_relationships() click to toggle source
# File lib/roo/excelx/relationships.rb, line 24
def extract_relationships
  return {} unless doc_exists?

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