Class: ORB::AST::NewlineNode

Inherits:
AbstractNode show all
Defined in:
lib/orb/ast/newline_node.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#attributes, #children, #errors

Instance Method Summary collapse

Methods inherited from AbstractNode

#add_child

Constructor Details

#initialize(token) ⇒ NewlineNode

Returns a new instance of NewlineNode.



8
9
10
11
# File 'lib/orb/ast/newline_node.rb', line 8

def initialize(token)
  super
  @text = token.value
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



6
7
8
# File 'lib/orb/ast/newline_node.rb', line 6

def text
  @text
end

Instance Method Details

#==(other) ⇒ Object



17
18
19
# File 'lib/orb/ast/newline_node.rb', line 17

def ==(other)
  super && @text == other.text
end

#render(_context) ⇒ Object



13
14
15
# File 'lib/orb/ast/newline_node.rb', line 13

def render(_context)
  @text
end