Class: Mathtype::FileParser
- Inherits:
-
Object
- Object
- Mathtype::FileParser
- Defined in:
- lib/file_parser/parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#equation ⇒ Object
readonly
Returns the value of attribute equation.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(path) ⇒ FileParser
constructor
A new instance of FileParser.
- #read_from_file(path) ⇒ Object
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
#equation ⇒ Object (readonly)
Returns the value of attribute equation.
4 5 6 |
# File 'lib/file_parser/parser.rb', line 4 def equation @equation end |
#raw ⇒ Object (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 |