class SyntaxTree::BasicVisitor::VisitMethodsChecker
This module is responsible for checking all of the methods defined within a given block to ensure that they are valid visit methods.
Constants
- Status
Attributes
status[R]
This is the status of the checker. It’s used to determine whether or not we should be checking the methods that are defined. It is kept as an instance variable so that it can be disabled later.
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/syntax_tree/basic_visitor.rb, line 53 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
Public Instance Methods
disable!()
click to toggle source
# File lib/syntax_tree/basic_visitor.rb, line 65 def disable! status.checking = false end