gem install has_keyword_argument
#has_keyword_argument?(*keyword)
lib/main.rb
def greeting(greeting:, name:)
return "#{greeting}, #{name}!"
end
def hello(name:)
return "Hello #{name}"
end
test/test_main.rb
require 'has_keyword_argument'
require_relative '../lib/main'
:hello.has_keyword_argument?(:name)
:greeting.has_keyword_argument?(:greeting, :name)