Class: SyntaxTree::ERB::NewLine

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/erb/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print, #skip?, #without_new_line

Constructor Details

#initialize(location:, count:) ⇒ NewLine

Returns a new instance of NewLine.



645
646
647
648
# File 'lib/syntax_tree/erb/nodes.rb', line 645

def initialize(location:, count:)
  @location = location
  @count = count
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



643
644
645
# File 'lib/syntax_tree/erb/nodes.rb', line 643

def count
  @count
end

#locationObject (readonly)

Returns the value of attribute location.



643
644
645
# File 'lib/syntax_tree/erb/nodes.rb', line 643

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



650
651
652
# File 'lib/syntax_tree/erb/nodes.rb', line 650

def accept(visitor)
  visitor.visit_new_line(self)
end

#child_nodesObject Also known as: deconstruct



654
655
656
# File 'lib/syntax_tree/erb/nodes.rb', line 654

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



660
661
662
# File 'lib/syntax_tree/erb/nodes.rb', line 660

def deconstruct_keys(keys)
  { location: location, count: count }
end