Class: RuboCop::Cop::Sorbet::EnforceSignatures::RBSSuggestion

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(indent) ⇒ RBSSuggestion

Returns a new instance of RBSSuggestion.



313
314
315
316
317
318
319
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 313

def initialize(indent)
  @params = []
  @returns = nil
  @has_block = false
  @attribute = false
  @indent = indent
end

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



311
312
313
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 311

def attribute
  @attribute
end

#has_blockObject

Returns the value of attribute has_block.



311
312
313
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 311

def has_block
  @has_block
end

#paramsObject

Returns the value of attribute params.



311
312
313
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 311

def params
  @params
end

#returnsObject

Returns the value of attribute returns.



311
312
313
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 311

def returns
  @returns
end

Instance Method Details

#to_autocorrectObject



321
322
323
# File 'lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb', line 321

def to_autocorrect
  "#: #{generate_signature}\n#{" " * @indent}"
end