class RuboCop::Cop::Style::HashConversion
def single_argument(node)
def single_argument(node) first_argument = node.first_argument if first_argument.hash_type? register_offense_for_hash(node, first_argument) elsif first_argument.splat_type? add_offense(node, message: MSG_SPLAT) unless allowed_splat_argument? elsif use_zip_method_without_argument?(first_argument) register_offense_for_zip_method(node, first_argument) else add_offense(node, message: MSG_TO_H) do |corrector| replacement = first_argument.source replacement = "(#{replacement})" if requires_parens?(first_argument) corrector.replace(node, "#{replacement}.to_h") end end end