class RuboCop::Cop::Style::ParallelAssignment::GenericCorrector
An internal class for correcting parallel assignment
Attributes
config[R]
correction[R]
correction_range[R]
node[R]
Public Class Methods
new(node, config, new_elements)
click to toggle source
# File lib/rubocop/cop/style/parallel_assignment.rb, line 164 def initialize(node, config, new_elements) @node = node @config = config @new_elements = new_elements end
Protected Instance Methods
assignment()
click to toggle source
# File lib/rubocop/cop/style/parallel_assignment.rb, line 180 def assignment @new_elements.map do |lhs, rhs| "#{lhs.source} = #{rhs.source}" end end
Private Instance Methods
cop_config()
click to toggle source
# File lib/rubocop/cop/style/parallel_assignment.rb, line 192 def cop_config @config.for_cop('Style/ParallelAssignment') end
extract_sources(node)
click to toggle source
# File lib/rubocop/cop/style/parallel_assignment.rb, line 188 def extract_sources(node) node.children.map(&:source) end