class SyntaxTree::EmbDoc

EmbDoc represents a multi-line comment.

=begin
first line
second line
=end

Attributes

value[R]
String

the contents of the comment

Public Class Methods

new(value:, location:) click to toggle source
# File lib/syntax_tree/node.rb, line 4959
def initialize(value:, location:)
  @value = value
  @location = location

  @leading = false
  @trailing = false
end

Public Instance Methods

===(other) click to toggle source
# File lib/syntax_tree/node.rb, line 5027
def ===(other)
  other.is_a?(EmbDoc) && value === other.value
end
accept(visitor) click to toggle source
# File lib/syntax_tree/node.rb, line 4995
def accept(visitor)
  visitor.visit_embdoc(self)
end
child_nodes() click to toggle source
# File lib/syntax_tree/node.rb, line 4999
def child_nodes
  []
end
Also aliased as: deconstruct
comments() click to toggle source
# File lib/syntax_tree/node.rb, line 4991
def comments
  []
end
copy(value: nil, location: nil) click to toggle source
# File lib/syntax_tree/node.rb, line 5003
def copy(value: nil, location: nil)
  EmbDoc.new(
    value: value || self.value,
    location: location || self.location
  )
end
deconstruct()
Alias for: child_nodes
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/node.rb, line 5012
def deconstruct_keys(_keys)
  { value: value, location: location }
end
format(q) click to toggle source
# File lib/syntax_tree/node.rb, line 5016
def format(q)
  if (q.parent.is_a?(DefNode) && q.parent.endless?) ||
       q.parent.is_a?(Statements)
    q.trim
  else
    q.breakable_return
  end

  q.text(value)
end
ignore?() click to toggle source
# File lib/syntax_tree/node.rb, line 4987
def ignore?
  false
end
inline?() click to toggle source
# File lib/syntax_tree/node.rb, line 4983
def inline?
  false
end
leading!() click to toggle source
# File lib/syntax_tree/node.rb, line 4967
def leading!
  @leading = true
end
leading?() click to toggle source
# File lib/syntax_tree/node.rb, line 4971
def leading?
  @leading
end
trailing!() click to toggle source
# File lib/syntax_tree/node.rb, line 4975
def trailing!
  @trailing = true
end
trailing?() click to toggle source
# File lib/syntax_tree/node.rb, line 4979
def trailing?
  @trailing
end