Class: Mathtype::FileParser

Inherits:
Object
  • Object
show all
Defined in:
lib/file_parser/parser.rb

Direct Known Subclasses

OleFileParser, WmfFileParser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileParser

Returns a new instance of FileParser.



5
6
7
# File 'lib/file_parser/parser.rb', line 5

def initialize(path)
  read_from_file(path)
end

Instance Attribute Details

#equationObject (readonly)

Returns the value of attribute equation.



4
5
6
# File 'lib/file_parser/parser.rb', line 4

def equation
  @equation
end

#rawObject (readonly)

Returns the value of attribute raw.



3
4
5
# File 'lib/file_parser/parser.rb', line 3

def raw
  @raw
end

Instance Method Details

#read_from_file(path) ⇒ Object



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

def read_from_file(path)
  f = File.open(path, "rb")
  @raw = f.read
  f.close
end