pda (owner)

Revisions

  • 218670 pda Wed Oct 28 04:36:36 -0700 2009
  • a6cfc2 pda Wed Oct 28 04:34:09 -0700 2009
gist: 220432 Download_button fork
public
Public Clone URL: git://gist.github.com/220432.git
Embed All Files: show embed
instance_eval_test.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class A
def with(&block)
instance_eval(&block)
end
private
def private_blarg
puts 'this is from a private method'
end
end
 
closured = 'this is inherited through closure'
 
A.new.with do
puts closured
private_blarg
end