class Hash class << self def ruby2_keywords_hash?(hash) !new(*[hash]).default.equal?(hash) end def ruby2_keywords_hash(hash) _ruby2_keywords_hash(**hash) end private def _ruby2_keywords_hash(*args) args.last end ruby2_keywords(:_ruby2_keywords_hash) if respond_to?(:ruby2_keywords, true) end end RUBY_VERSION # => "2.7.0" def passed_kw?(*args) Hash.ruby2_keywords_hash?(args.last) end ruby2_keywords(