title: Inline hash assignment and usage
body: <p>I have the following method declaration:</p>
  
  <pre><code>  def do_staff
      param_a = condition1 &amp;&amp; condition2
      param_b = 100
      param_c = param_a ? 'good' : 'bad'
      # method logic implementation ....
    end
  </code></pre>
  
  <p>After using <code>rubocop gem</code> to analyze my code, I found that <code>do_staff</code> has more than 10 lines of code, so I need to add the params definition to single hash such as:</p>
  
  <pre><code>args = { param_a: condition1 &amp;&amp; condition2, param_b: 100, param_c: args[:param_a] ? 'good' : 'bad' }
  </code></pre>
  
  <p>The <code>args</code> declaration will definitely throw <code>undefined method '[]' for nil:NilClass</code> because of <code>param_c</code>:</p>
  
  <pre><code>{ param_c: args[:param_a] ? 'good' : 'bad' }
  </code></pre>
  
  <p><strong>The Question is:</strong></p>
  
  <p>Is there any possibility in Ruby to implement such inline declaration where I can avoid repeating the logic of <code>param_a</code> definition while defining <code>param_c</code>?</p>