Class: PnoteClient::Documents::Hml::Equation
- Inherits:
-
Object
- Object
- PnoteClient::Documents::Hml::Equation
- Defined in:
- lib/pnote_client/documents/hml/equation.rb
Class Method Summary collapse
-
.from_tag(eq_tag) ⇒ Object
Textable Element.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(script) ⇒ Equation
constructor
A new instance of Equation.
- #textable? ⇒ Boolean
Constructor Details
#initialize(script) ⇒ Equation
Returns a new instance of Equation.
14 15 16 17 |
# File 'lib/pnote_client/documents/hml/equation.rb', line 14 def initialize(script) @script = script @script_converter = ::HwpScriptToLatex::Converter.new end |
Class Method Details
.from_tag(eq_tag) ⇒ Object
Textable Element
9 10 11 12 |
# File 'lib/pnote_client/documents/hml/equation.rb', line 9 def self.from_tag(eq_tag) script = eq_tag.xpath("SCRIPT")[0].content return self.new(script) end |
Instance Method Details
#content ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/pnote_client/documents/hml/equation.rb', line 19 def content if @script_converter return @script_converter.convert(@script, math_mode: true, display_mode: true) else return @script end end |
#textable? ⇒ Boolean
27 28 29 |
# File 'lib/pnote_client/documents/hml/equation.rb', line 27 def textable? return true end |