class Sorbet::Eraser::Parser::Node
Represents a node in the AST. Keeps track of the event that generated it, any child nodes that descend from it, and the location in the source.
Attributes
body[R]
event[R]
range[R]
Public Class Methods
new(event, body, range)
click to toggle source
# File lib/sorbet/eraser/parser.rb, line 48 def initialize(event, body, range) @event = event @body = body @range = range end
Public Instance Methods
match?(pattern)
click to toggle source
# File lib/sorbet/eraser/parser.rb, line 54 def match?(pattern) to_s.match?(pattern) end
to_s()
click to toggle source
# File lib/sorbet/eraser/parser.rb, line 58 def to_s @to_s ||= "<#{event} #{body.map(&:to_s).join(" ")}>" end