2016年5月12日

摘要: 11.2 listing object’s method Oject.methods/singleton_methods/instance_methods 指定类名定义的方法在 singleton_methods MyClass.method_defined? :my_instance_method MyClass.respond_to? :my_singleton_method for... 阅读全文
posted @ 2016-05-12 17:03 anjuncc 阅读(116) 评论(0) 推荐(0)
摘要: 一 对象模型 kernel Module Kernel.private_instance_methods.grep(/^pr/) private method 1 如果一个方法接收者不是你自己,一定要指定一个接收者 2 私有方法 只能指定一个隐含接收者(可调超类的私有方法) 类本身是Class类的对象。类的名字是个常量 Class<Module,模块和类的名字扮演目录角色,... 阅读全文
posted @ 2016-05-12 12:13 anjuncc 阅读(221) 评论(0) 推荐(0)

导航