Class: SyntaxTree::BasicVisitor::VisitMethodChecker
- Inherits:
-
Object
- Object
- SyntaxTree::BasicVisitor::VisitMethodChecker
- Defined in:
- lib/syntax_tree/basic_visitor.rb
Overview
This class is used by DidYouMean to offer corrections to invalid visit method names.
Instance Attribute Summary collapse
-
#visit_method ⇒ Object
readonly
Returns the value of attribute visit_method.
Instance Method Summary collapse
- #corrections ⇒ Object
-
#initialize(error) ⇒ VisitMethodChecker
constructor
A new instance of VisitMethodChecker.
Constructor Details
#initialize(error) ⇒ VisitMethodChecker
Returns a new instance of VisitMethodChecker.
25 26 27 |
# File 'lib/syntax_tree/basic_visitor.rb', line 25 def initialize(error) @visit_method = error.visit_method end |
Instance Attribute Details
#visit_method ⇒ Object (readonly)
Returns the value of attribute visit_method.
23 24 25 |
# File 'lib/syntax_tree/basic_visitor.rb', line 23 def visit_method @visit_method end |
Instance Method Details
#corrections ⇒ Object
29 30 31 32 33 34 |
# File 'lib/syntax_tree/basic_visitor.rb', line 29 def corrections @corrections ||= DidYouMean::SpellChecker.new( dictionary: BasicVisitor.valid_visit_methods ).correct(visit_method) end |