Class: RuboCop::Cop::RSpec::ReturnFromStub::AndReturnCallCorrector
- Inherits:
-
Object
- Object
- RuboCop::Cop::RSpec::ReturnFromStub::AndReturnCallCorrector
- Defined in:
- lib/rubocop/cop/rspec/return_from_stub.rb
Overview
:nodoc:
Instance Method Summary collapse
- #call(corrector) ⇒ Object
-
#initialize(node) ⇒ AndReturnCallCorrector
constructor
A new instance of AndReturnCallCorrector.
Constructor Details
#initialize(node) ⇒ AndReturnCallCorrector
Returns a new instance of AndReturnCallCorrector.
96 97 98 99 100 |
# File 'lib/rubocop/cop/rspec/return_from_stub.rb', line 96 def initialize(node) @node = node @receiver = node.receiver @arg = node.first_argument end |
Instance Method Details
#call(corrector) ⇒ Object
102 103 104 105 106 107 |
# File 'lib/rubocop/cop/rspec/return_from_stub.rb', line 102 def call(corrector) # Heredoc autocorrection is not yet implemented. return if heredoc? corrector.replace(range, " { #{replacement} }") end |