title: use .try function with .map function in ruby
body: <p>I need to get some values from the json record and extracting like below</p>
  
  <pre><code>curr_json_doc['title']['genre'].map { |s| s['name'] }.join(',')
  </code></pre>
  
  <p>But for some records curr_json_doc['title']['genre'] can be blank. So I want to use try function for map and join().</p>
  
  <p>I tried like below </p>
  
  <pre><code>curr_json_doc['title']['genre'].try(:map, { |s| s['name'] }).try(:join, (','))
  </code></pre>
  
  <p>but it didnt work. </p>