Class: RuboCop::Cop::Sorbet::EnforceSignatures::RBSSuggestion
- Inherits:
-
Object
- Object
- RuboCop::Cop::Sorbet::EnforceSignatures::RBSSuggestion
- Defined in:
- lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb
Instance Attribute Summary collapse
-
#has_block ⇒ Object
Returns the value of attribute has_block.
-
#params ⇒ Object
Returns the value of attribute params.
-
#returns ⇒ Object
Returns the value of attribute returns.
Instance Method Summary collapse
-
#initialize(indent) ⇒ RBSSuggestion
constructor
A new instance of RBSSuggestion.
- #to_autocorrect ⇒ Object
Constructor Details
#initialize(indent) ⇒ RBSSuggestion
Returns a new instance of RBSSuggestion.
299 300 301 302 303 304 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 299 def initialize(indent) @params = [] @returns = nil @has_block = false @indent = indent end |
Instance Attribute Details
#has_block ⇒ Object
Returns the value of attribute has_block.
297 298 299 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 297 def has_block @has_block end |
#params ⇒ Object
Returns the value of attribute params.
297 298 299 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 297 def params @params end |
#returns ⇒ Object
Returns the value of attribute returns.
297 298 299 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 297 def returns @returns end |
Instance Method Details
#to_autocorrect ⇒ Object
306 307 308 |
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 306 def to_autocorrect "#: #{generate_signature}\n#{" " * @indent}" end |