class SyntaxTree::Comment
Comment
represents a comment in the source.
# comment
Attributes
- boolean
-
whether or not there is code on the same line as this comment.
If there is, then inline will be true.
- boolean
-
whether or not there is code on the same line as this comment.
If there is, then inline will be true.
- String
-
the contents of the comment
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 3749 def initialize(value:, inline:, location:) @value = value @inline = inline @location = location @leading = false @trailing = false end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 3808 def ===(other) other.is_a?(Comment) && value === other.value && inline === other.inline end
Source
# File lib/syntax_tree/node.rb, line 3782 def accept(visitor) visitor.visit_comment(self) end
Source
# File lib/syntax_tree/node.rb, line 3786 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 3790 def copy(value: nil, inline: nil, location: nil) Comment.new( value: value || self.value, inline: inline || self.inline, location: location || self.location ) end
Source
# File lib/syntax_tree/node.rb, line 3800 def deconstruct_keys(_keys) { value: value, inline: inline, location: location } end
Source
# File lib/syntax_tree/node.rb, line 3774 def ignore? value.match?(/\A#\s*stree-ignore\s*\z/) end