class RubbyCop::Cop::Style::ParallelAssignment::ModifierCorrector

An internal class for correcting parallel assignment guarded by if, unless, while, or until

Public Instance Methods

correction() click to toggle source
# File lib/rubbycop/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() click to toggle source
# File lib/rubbycop/cop/style/parallel_assignment.rb, line 272
def correction_range
  node.parent.source_range
end

Private Instance Methods

modifier_range(node) click to toggle source
# File lib/rubbycop/cop/style/parallel_assignment.rb, line 278
def modifier_range(node)
  Parser::Source::Range.new(node.source_range.source_buffer,
                            node.loc.keyword.begin_pos,
                            node.source_range.end_pos)
end