class SyntaxTree::BasicVisitor::VisitMethodsChecker
a given block to ensure that they are valid visit methods.
This module is responsible for checking all of the methods defined within
def disable!
def disable! status.checking = false end
def initialize
def initialize # We need the status to be an instance variable so that it can be # accessed by the disable! method, but also a local variable so that it # can be captured by the define_method block. status = @status = Status.new(true) define_method(:method_added) do |name| BasicVisitor.visit_method(name) if status.checking super(name) end end