title: Ruby convert string to keyword argument
body: <p>I have a function in ruby that takes keyword arguments in the following form:</p>
  
  <pre><code>def get_customer_information(name: nil, dob: nil, age: nil, state: nil)
     ... query db based on supplied parameters
  end
  </code></pre>
  
  <p>The user can specify 1 to all of the keyword arguments. There is also a command line interface where the user can leverage this function by calling a command line call and passing in a key/value of information of the following form:</p>
  
  <pre><code>&gt;GetCustomerInformation name=myName, dob=myDOB
  </code></pre>
  
  <p>The parameters are parsed and separated into keys and values. However, I need to know which keyword argument is associated with the supplied input from the command line. Is there a way to convert a string to a keyword argument (for example, convert name to name:) so that I need not perform string comparison on each parameter to determine which keyword argument it is associated with, resulting in a call of the form:</p>
  
  <pre><code>get_customer_information(name.to_keyword myName, dob.to_keyword myDOB)
  </code></pre>
  
  <p>Or is this not possible in ruby?</p>