Class: AsciiMath::AST::ValueNode

Inherits:
Node
  • Object
show all
Defined in:
lib/asciimath/ast.rb

Direct Known Subclasses

Color, Identifier, Number, Symbol, Text

Instance Attribute Summary collapse

Attributes inherited from Node

#parent

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ValueNode

Returns a new instance of ValueNode.



311
312
313
314
# File 'lib/asciimath/ast.rb', line 311

def initialize(value)
  super()
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



309
310
311
# File 'lib/asciimath/ast.rb', line 309

def value
  @value
end

Instance Method Details

#==(o) ⇒ Object



320
321
322
# File 'lib/asciimath/ast.rb', line 320

def ==(o)
  o.class == self.class && o.value == value
end

#to_sObject



316
317
318
# File 'lib/asciimath/ast.rb', line 316

def to_s
  value.to_s
end