comparison scripts/dgen.rb @ 3:d0162d8ca0f2

Added support for function pointers in dstepgen
author Jacob Carlborg <doob@me.com>
date Sun, 05 Jul 2009 20:54:42 +0200
parents 9fd439a28ce3
children 5a1a6afbfe3a
comparison
equal deleted inserted replaced
2:9fd439a28ce3 3:d0162d8ca0f2
152 152
153 def method_missing (method, *args) 153 def method_missing (method, *args)
154 self.class.instance_eval do 154 self.class.instance_eval do
155 define_method(method) do |*args| 155 define_method(method) do |*args|
156 if args.length > 0 156 if args.length > 0
157 self[method[0 ... -1]] = args[0] 157 #self[method[0 ... -1]] = args[0]
158 self[eval(":#{method}"[0 ... -1])] = args[0] 158 self[eval(":#{method}"[0 ... -1])] = args[0]
159 else 159 else
160 result = self[method] 160 result = self[method]
161 return result unless result.nil? 161 return result unless result.nil?
162 self[eval(":#{method}")] 162 self[eval(":#{method}")]