title: define_method with predefined keyword arguments
body: <p>I want to define a method that takes keyword arguments. I would like it to raise when keyword arguments are not provided, and I can code this myself - but ideally I would like to let Ruby do that for me. Also I would like to be able to inspect the freshly defined method using <code>Method#parameters</code>. If I use a shorthand double-splat (like <code>**kwargs</code>) the actual structure I expect is not visible to <code>parameters</code>.</p>
  
  <p>I can of course do this:</p>
  
  <pre><code>define_method(:foo) do | foo:, bar: |
    # ...
  end
  </code></pre>
  
  <p>which achieves the desired result:</p>
  
  <pre><code>method(:foo).parameters
  # =&gt; [[:keyreq, :foo], [:keyreq, :bar]]
  </code></pre>
  
  <p>but I cannot pass those arguments programmatically, they have to be literally placed in the code. Is there a way I could bypass this?</p>