Class: AsciiMath::AST::Symbol
- Defined in:
- lib/asciimath/ast.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from ValueNode
Attributes inherited from Node
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize(value, text, type) ⇒ Symbol
constructor
A new instance of Symbol.
- #to_s ⇒ Object
Constructor Details
#initialize(value, text, type) ⇒ Symbol
Returns a new instance of Symbol.
345 346 347 348 349 |
# File 'lib/asciimath/ast.rb', line 345 def initialize(value, text, type) super(value) @text = text.dup.freeze @type = type end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
342 343 344 |
# File 'lib/asciimath/ast.rb', line 342 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
343 344 345 |
# File 'lib/asciimath/ast.rb', line 343 def type @type end |
Instance Method Details
#==(o) ⇒ Object
351 352 353 |
# File 'lib/asciimath/ast.rb', line 351 def ==(o) super && o.text == text && o.type == type end |
#to_s ⇒ Object
355 356 357 |
# File 'lib/asciimath/ast.rb', line 355 def to_s text end |