title: Escaping a variable (containing an array)
body: <p>I want to have a hash <code>my_statement</code> as below:</p>
  
  <pre><code>my_statement = %|{:foo=&gt;\#{bar_array}}|
  </code></pre>
  
  <p>where <code>:foo</code> is the key and the value is to be substituted with the value of <code>bar_array</code> later. After I later define <code>bar_array = ["a","b"]</code>, I do an <code>eval</code> on this statement, and want it to show the following:</p>
  
  <pre><code>eval(my_statement)
  # =&gt; {:foo=&gt;["a", "b"]}
  </code></pre>
  
  <p>I need to escape the variable <code>bar_array</code> so that it evaluates not when <code>my_statement</code> is assigned but rather when <code>eval</code> is called on it. I can't seem to get the escaping of the variable.  I tried <code>\#</code>, <code>#</code>, <code>\\#</code>.</p>
  
  <p>The background of why I am doing this:
  I have several statically defined charts backed by SOLR queries.  I took the approach to define these queries in a serializable column in the database (again they "never" change).  There are actually two levels of queries; the first level which gets "all" data for that query; and the second level which is based on the user selecting some data (off of a chart) from the first query - i.e., I need a variable to be part of the second query.  Sometimes (like in this example) the variable will contain an array.</p>