Class: RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
- Inherits:
-
Object
- Object
- RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
- Defined in:
- lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#returns ⇒ Object
Returns the value of attribute returns.
Instance Method Summary collapse
-
#initialize(indent, param_placeholder, return_placeholder) ⇒ SigSuggestion
constructor
A new instance of SigSuggestion.
- #to_autocorrect ⇒ Object
Constructor Details
#initialize(indent, param_placeholder, return_placeholder) ⇒ SigSuggestion
Returns a new instance of SigSuggestion.
269 270 271 272 273 274 275 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 269 def initialize(indent, param_placeholder, return_placeholder) @params = [] @returns = nil @indent = indent @param_placeholder = param_placeholder @return_placeholder = return_placeholder end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
267 268 269 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 267 def params @params end |
#returns ⇒ Object
Returns the value of attribute returns.
267 268 269 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 267 def returns @returns end |
Instance Method Details
#to_autocorrect ⇒ Object
277 278 279 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 277 def to_autocorrect "sig { #{generate_params}#{generate_return} }\n#{" " * @indent}" end |