Class: RuboCop::Cop::Style::ParallelAssignment::GenericCorrector
- Inherits:
-
Object
- Object
- RuboCop::Cop::Style::ParallelAssignment::GenericCorrector
- Includes:
- Alignment
- Defined in:
- lib/rubocop/cop/style/parallel_assignment.rb
Overview
An internal class for correcting parallel assignment
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #correction ⇒ Object
- #correction_range ⇒ Object
-
#initialize(node, config, new_elements) ⇒ GenericCorrector
constructor
A new instance of GenericCorrector.
Constructor Details
#initialize(node, config, new_elements) ⇒ GenericCorrector
Returns a new instance of GenericCorrector.
184 185 186 187 188 |
# File 'lib/rubocop/cop/style/parallel_assignment.rb', line 184 def initialize(node, config, new_elements) @node = node @config = config @new_elements = new_elements end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
182 183 184 |
# File 'lib/rubocop/cop/style/parallel_assignment.rb', line 182 def config @config end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
182 183 184 |
# File 'lib/rubocop/cop/style/parallel_assignment.rb', line 182 def node @node end |
Instance Method Details
#correction ⇒ Object
190 191 192 |
# File 'lib/rubocop/cop/style/parallel_assignment.rb', line 190 def correction assignment.join("\n#{offset(node)}") end |
#correction_range ⇒ Object
194 195 196 |
# File 'lib/rubocop/cop/style/parallel_assignment.rb', line 194 def correction_range node.source_range end |