method_missing is a very useful tool for dynamic programming.
It is easy to implement in ruby:
class Fren
def method_missing(*info)
puts "method called: #{info.shift} does not exist"
puts "received parameters:"
info.each { |v| puts v }
end
end
The parameters passed to method_missing include the symbol for the ‘method’ along with any arguments. The parameters are stored in [...]
Filed under: C, metaprogramming, programming, ruby | Tagged: C, C extension, method_missing, ruby | Leave a Comment »