Class: Ovec::MathNode
Constant Summary collapse
- INLINE =
:inline
- DISPLAY =
:display
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, content) ⇒ MathNode
constructor
A new instance of MathNode.
- #to_tex ⇒ Object
Constructor Details
#initialize(type, content) ⇒ MathNode
Returns a new instance of MathNode.
71 72 73 74 |
# File 'lib/ovec/nodes.rb', line 71 def initialize(type, content) @type = type @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
85 86 87 |
# File 'lib/ovec/nodes.rb', line 85 def content @content end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
84 85 86 |
# File 'lib/ovec/nodes.rb', line 84 def type @type end |
Instance Method Details
#to_tex ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/ovec/nodes.rb', line 76 def to_tex if type == INLINE "$#{content}$" else "$$#{content}$$" end end |