Class: Johnson::Nodes::Node
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Visitable
#accept
Constructor Details
#initialize(line, column, value) ⇒ Node
Returns a new instance of Node.
35
36
37
38
39
|
# File 'lib/johnson/nodes/node.rb', line 35
def initialize(line, column, value)
@line = line
@column = column
@value = value
end
|
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column.
34
35
36
|
# File 'lib/johnson/nodes/node.rb', line 34
def column
@column
end
|
#line ⇒ Object
Returns the value of attribute line.
34
35
36
|
# File 'lib/johnson/nodes/node.rb', line 34
def line
@line
end
|
#value ⇒ Object
Returns the value of attribute value.
33
34
35
|
# File 'lib/johnson/nodes/node.rb', line 33
def value
@value
end
|
Instance Method Details
#to_dot ⇒ Object
57
58
59
|
# File 'lib/johnson/nodes/node.rb', line 57
def to_dot
DotVisitor.new { |d| d.accept(self) }
end
|
#to_ecma ⇒ Object
Also known as:
to_js
#to_s ⇒ Object
Also known as:
inspect
41
42
43
|
# File 'lib/johnson/nodes/node.rb', line 41
def to_s
to_sexp.inspect
end
|
#to_sexp ⇒ Object
47
48
49
|
# File 'lib/johnson/nodes/node.rb', line 47
def to_sexp
SexpVisitor.new.accept(self)
end
|