Ruby Metaprogramming方法列表?

刚开始学习 Ruby元编程.看看Object.methods我得到:
Object.methods => [
:allocate,:new,:superclass,:freeze,:===,:==,:<=>,:<,:<=,:>,:>=,:to_s,:included_modules,:include?,:name,:ancestors,:instance_methods,:public_instance_methods,:protected_instance_methods,:private_instance_methods,:constants,:const_get,:const_set,:const_defined?,:const_missing,:class_variables,:remove_class_variable,:class_variable_get,:class_variable_set,:class_variable_defined?,:module_exec,:class_exec,:module_eval,:class_eval,:method_defined?,:public_method_defined?,:private_method_defined?,:protected_method_defined?,:public_class_method,:private_class_method,:autoload,:autoload?,:instance_method,:public_instance_method,:nil?,:=~,:!~,:eql?,:hash,:class,:singleton_class,:clone,:dup,:initialize_dup,:initialize_clone,:taint,:tainted?,:untaint,:untrust,:untrusted?,:trust,:frozen?,:inspect,:methods,:singleton_methods,:protected_methods,:private_methods,:public_methods,:instance_variables,:instance_variable_get,:instance_variable_set,:instance_variable_defined?,:instance_of?,:kind_of?,:is_a?,:tap,:send,:public_send,:respond_to?,:respond_to_missing?,:extend,:display,:method,:public_method,:define_singleton_method,:__id__,:object_id,:to_enum,:enum_for,:equal?,:!,:!=,:instance_eval,:instance_exec,:__send__]

是否有一个对元编程有用的方法列表?例如instance_eval,initialize和method_missing?

解决方法

以下是 this页面的最佳答案:

方法相关的钩子

method_missing
method_added
singleton_method_added
method_removed
singleton_method_removed
method_undefined
singleton_method_undefined

班级&模块挂钩

inherited
append_features
included
extend_object
extended
initialize_copy
const_missing

编组挂钩

marshal_dump
marshal_load

强制钩子

coerce
induced_from
to_xxx

另外,请查看this博客文章,了解其中许多方法的解释和示例代码.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...