From: Intransition Date: 2011-11-15T09:11:49+09:00 Subject: Re: Binding#with ------=_Part_2534_3127309.1321315905684 Content-Type: multipart/alternative; boundary="----=_Part_2535_16526123.1321315905684" ------=_Part_2535_16526123.1321315905684 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Try q = 5 binding.with(:a => 10) { |x| x + x }.eval('yield q + a + 5') # => Error `q` being in the "context of the original binding". ------=_Part_2535_16526123.1321315905684 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Try

  q = 5
  binding.with(:a => 10) { |x| x + x }.eval('yield q + a + 5')  # => Error

`q` being in the "context of the original binding".

------=_Part_2535_16526123.1321315905684-- ------=_Part_2534_3127309.1321315905684--