aboutsummaryrefslogtreecommitdiffstats
path: root/lib/roo/excelx/relationships.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-02-01 19:23:07 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-02-01 19:23:07 -0500
commit5a669c40673841aad681da3fe343c4a902a3bf6c (patch)
treeeec5e8bf16e20eef2f192ca056e8702d47c5d989 /lib/roo/excelx/relationships.rb
parenteeb0202b3730c4b9596b6b409f565e9f5a8dce4c (diff)
parent46eadd2724cd841328d90c3143a485fcdf423ed6 (diff)
Update upstream source from tag 'upstream/2.8.2'
Update to upstream version '2.8.2' with Debian dir b1ec8fbbaccffac36549be25adf232dec8fac090
Diffstat (limited to 'lib/roo/excelx/relationships.rb')
-rw-r--r--lib/roo/excelx/relationships.rb10
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