Class: Mathtype::OleFileParser

Inherits:
FileParser show all
Defined in:
lib/file_parser/ole.rb

Instance Attribute Summary

Attributes inherited from FileParser

#equation, #raw

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ OleFileParser

Returns a new instance of OleFileParser.



6
7
8
# File 'lib/file_parser/ole.rb', line 6

def initialize(path)
  read_from_file(path)
end

Instance Method Details

#read_from_file(path) ⇒ Object



9
10
11
12
13
# File 'lib/file_parser/ole.rb', line 9

def read_from_file(path)
  ole = Ole::Storage.open(path, "rb+")
  @equation = ole.file.read("Equation Native")[28..-1]
  ole.close
end