title: ruby lambda context
body: <p>Lets say I have the following ruby definition at the topmost level</p>
  
  <pre><code>callable = lambda {"#{hi}"}
  </code></pre>
  
  <p>and suppose that later on I create an object called <code>temp</code> that has a method called <code>hi</code>. Now what I would like to do is call <code>callable</code> within the context of <code>temp</code>. I have tried doing</p>
  
  <pre><code>temp.instance_eval do callable.call end
  </code></pre>
  
  <p>but this gives me the error "<code>NameError: undefined local variable or method 'hi' for main:Object</code>". I would like to know if there is any way to rebind the context of <code>callable</code> to <code>temp</code> so that I don't get an error message? I know that I could define <code>method_missing</code> on main:Object and reroute all method calls to <code>temp</code> but this seems like way too big of a hack to accomplish what I want.</p>