From: Alexey Petrushin Date: 2009-02-03T02:11:32+09:00 Subject: Kernel.xxx interferes with method_missing Hello! I'm using method_missing to create DSL, the problem is that Kernel.xxx methods are interferes with it. How this issue can be solved? It seems that one solution is to explicitly define all global methods (p, select, ...) on the target class for method_missing. But i hope there is more elegant solution :). Maybe some trick with sandboxes? CODE: class Parameters # < BlankSlate attr_reader :result def initialize &block @result = {} instance_eval &block end def method_missing m, *p @result[m] = *p end end describe do it do hash = Parameters.new do one 1 select1 'Select' # <= Problem here, it calls Kernel.select end.result hash.should == {:one => 1, :select1 => 'Select'} end end -- Posted via http://www.ruby-forum.com/.