Class: RuboCop::Cop::Style::ParallelAssignment::ModifierCorrector
- Inherits:
-
GenericCorrector
- Object
- GenericCorrector
- RuboCop::Cop::Style::ParallelAssignment::ModifierCorrector
- Defined in:
- lib/rubocop/cop/style/parallel_assignment.rb
Overview
An internal class for correcting parallel assignment guarded by if, unless, while, or until
Instance Attribute Summary
Attributes inherited from GenericCorrector
Instance Method Summary collapse
Methods inherited from GenericCorrector
Constructor Details
This class inherits a constructor from RuboCop::Cop::Style::ParallelAssignment::GenericCorrector
Instance Method Details
#correction ⇒ Object
263 264 265 266 267 268 269 270 |
# File 'lib/rubocop/cop/style/parallel_assignment.rb', line 263 def correction parent = node.parent "#{modifier_range(parent).source}\n" \ "#{indentation(node)}" \ "#{assignment.join("\n#{indentation(node)}")}" \ "\n#{offset(node)}end" end |
#correction_range ⇒ Object
272 273 274 |
# File 'lib/rubocop/cop/style/parallel_assignment.rb', line 272 def correction_range node.parent.source_range end |