jerk
]]>BTW,
1 | eval("#{m}(#{args})") |
could be rewritten using
1 | self.send(m, args) |
1 2 3 4 5 6 7 8 9 10 | class Sphinx::Client def method_missing(m, *args) m = m.to_s.camelize if self.methods.include?(m) eval("#{m}(#{args})") else raise NoMethodError, "undefined method '#{m}'" end end end |
BTW. My opinion is that Ruby methods should always be of the form: object.method_call. And not object.MethodCall..
But this is just my humble opinion.