P
Patrick Li
Hi i'm creating a DSL, and would like to use the following
functionality.It works fine in irb but when I run it from the
commandline. Does it look like my fault or a ruby bug?
class A
def method
puts "a"
end
def A.create
A.new.instance_eval { yield }
end
end
A.create{method}
PS: I'm on "ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]"
functionality.It works fine in irb but when I run it from the
commandline. Does it look like my fault or a ruby bug?
class A
def method
puts "a"
end
def A.create
A.new.instance_eval { yield }
end
end
A.create{method}
PS: I'm on "ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]"