aboutsummaryrefslogtreecommitdiffstats
path: root/lib/roo/excelx/extractor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/roo/excelx/extractor.rb')
-rw-r--r--lib/roo/excelx/extractor.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/roo/excelx/extractor.rb b/lib/roo/excelx/extractor.rb
new file mode 100644
index 0000000..1cdd13b
--- /dev/null
+++ b/lib/roo/excelx/extractor.rb
@@ -0,0 +1,21 @@
+module Roo
+ class Excelx
+ class Extractor
+ def initialize(path)
+ @path = path
+ end
+
+ private
+
+ def doc
+ raise FileNotFound, "#{@path} file not found" unless doc_exists?
+
+ ::Roo::Utils.load_xml(@path).remove_namespaces!
+ end
+
+ def doc_exists?
+ @path && File.exist?(@path)
+ end
+ end
+ end
+end