Class: Solargraph::Rspec::Correctors::LetMethodsCorrector
- Inherits:
-
WalkerBase
- Object
- Base
- WalkerBase
- Solargraph::Rspec::Correctors::LetMethodsCorrector
- Defined in:
- lib/solargraph/rspec/correctors/let_methods_corrector.rb
Overview
Defines let-like methods in the example group block
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from WalkerBase
#namespace_pins, #rspec_walker
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from WalkerBase
Methods inherited from Base
Constructor Details
This class inherits a constructor from Solargraph::Rspec::Correctors::WalkerBase
Instance Method Details
#correct(_source_map) ⇒ void
This method returns an undefined value.
12 13 14 15 16 17 18 19 20 |
# File 'lib/solargraph/rspec/correctors/let_methods_corrector.rb', line 12 def correct(_source_map) rspec_walker.on_let_method do |let_name, location_range, fake_method_ast| namespace_pin = closest_namespace_pin(namespace_pins, location_range.start.line) next unless namespace_pin pin = rspec_let_method(namespace_pin, let_name, location_range, fake_method_ast) yield [pin] if block_given? end end |