class RuboCop::Cop::Performance::StringReplacement

def first_source(first_param)

def first_source(first_param)
  case first_param.type
  when :regexp
    source_from_regex_literal(first_param)
  when :send
    source_from_regex_constructor(first_param)
  when :str
    first_param.children.first
  end
end