Class: AsciiMath::AST::Symbol

Inherits:
ValueNode show all
Defined in:
lib/asciimath/ast.rb

Instance Attribute Summary collapse

Attributes inherited from ValueNode

#value

Attributes inherited from Node

#parent

Instance Method Summary collapse

Constructor Details

#initialize(value, text) ⇒ Symbol

Returns a new instance of Symbol.



344
345
346
347
# File 'lib/asciimath/ast.rb', line 344

def initialize(value, text)
  super(value)
  @text = text.dup.freeze
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



342
343
344
# File 'lib/asciimath/ast.rb', line 342

def text
  @text
end

Instance Method Details

#==(o) ⇒ Object



349
350
351
# File 'lib/asciimath/ast.rb', line 349

def ==(o)
  super && o.text == text
end

#to_sObject



353
354
355
# File 'lib/asciimath/ast.rb', line 353

def to_s
  text
end