class SyntaxTree::BasicVisitor::VisitMethodChecker

This class is used by DidYouMean to offer corrections to invalid visit method names.

Attributes

visit_method[R]

Public Class Methods

new(error) click to toggle source
# File lib/syntax_tree/basic_visitor.rb, line 25
def initialize(error)
  @visit_method = error.visit_method
end

Public Instance Methods

corrections() click to toggle source
# File lib/syntax_tree/basic_visitor.rb, line 29
def corrections
  @corrections ||=
    DidYouMean::SpellChecker.new(
      dictionary: BasicVisitor.valid_visit_methods
    ).correct(visit_method)
end