411 REFERENCE · Wikibooks
Ruby Programming/Syntax/Hooks
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Ruby provides callbacks, to, for example, know when a new method is defined (later) in a class.
Here is a list of known callbacks.
const_missing
class Object
def self.const_missing c
p 'missing const was', c
end
end
or more
class Object
class << self
alias :const_missing_old :const_missing
def const_missing c
p 'const missing is', c
const_missing_old c
end
end
end