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, 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

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end

#typeObject (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_sObject



355
356
357
# File 'lib/asciimath/ast.rb', line 355

def to_s
  text
end