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.



675
676
677
678
# File 'lib/syntax_tree/erb/nodes.rb', line 675

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

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



673
674
675
# File 'lib/syntax_tree/erb/nodes.rb', line 673

def count
  @count
end

#locationObject (readonly)

Returns the value of attribute location.



673
674
675
# File 'lib/syntax_tree/erb/nodes.rb', line 673

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



680
681
682
# File 'lib/syntax_tree/erb/nodes.rb', line 680

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

#child_nodesObject Also known as: deconstruct



684
685
686
# File 'lib/syntax_tree/erb/nodes.rb', line 684

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



690
691
692
# File 'lib/syntax_tree/erb/nodes.rb', line 690

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