diff options
| author | 2019-02-01 19:22:38 -0500 | |
|---|---|---|
| committer | 2019-02-01 19:22:38 -0500 | |
| commit | 46eadd2724cd841328d90c3143a485fcdf423ed6 (patch) | |
| tree | eb23c011f1c80a4cce169d9d9523a28927770b12 /lib/roo/excelx/relationships.rb | |
| parent | 16dd018ca735392c2fb28b986316a9b22a06ccf9 (diff) | |
New upstream version 2.8.2upstream/2.8.2
Diffstat (limited to 'lib/roo/excelx/relationships.rb')
| -rw-r--r-- | lib/roo/excelx/relationships.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/roo/excelx/relationships.rb b/lib/roo/excelx/relationships.rb index 19f9919..754775d 100644 --- a/lib/roo/excelx/relationships.rb +++ b/lib/roo/excelx/relationships.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'roo/excelx/extractor' module Roo @@ -11,10 +13,16 @@ module Roo @relationships ||= extract_relationships end + def include_type?(type) + to_a.any? do |_, rel| + rel["Type"]&.include? type + end + end + private def extract_relationships - return [] unless doc_exists? + return {} unless doc_exists? doc.xpath('/Relationships/Relationship').each_with_object({}) do |rel, hash| hash[rel['Id']] = rel |
