Class: DocImageExtract::Reader::Xwpf
- Inherits:
-
Object
- Object
- DocImageExtract::Reader::Xwpf
- Defined in:
- lib/doc_image_extract/reader/xwpf.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(file) ⇒ Xwpf
constructor
A new instance of Xwpf.
- #pictures ⇒ Object
Constructor Details
#initialize(file) ⇒ Xwpf
Returns a new instance of Xwpf.
11 12 13 |
# File 'lib/doc_image_extract/reader/xwpf.rb', line 11 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/doc_image_extract/reader/xwpf.rb', line 9 def file @file end |
Instance Method Details
#pictures ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/doc_image_extract/reader/xwpf.rb', line 15 def pictures document = XWPFDocument.new FileInputStream.new file pictures = document.get_all_pictures pictures.map do |picture| filename = picture.get_file_name data = picture.get_data Picture.new filename, data end end |