首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Ruby 元编程 编纂代码的代码

2013-09-09 
Ruby 元编程编写代码的代码1.Kernel#eval2.0.0p247 :463 class String2.0.0p247 :464?def self.inherite

Ruby 元编程 编写代码的代码


1.Kernel#eval

2.0.0p247 :463 >   class String2.0.0p247 :464?>    def self.inherited(subclass)2.0.0p247 :465?>     puts "钩子函数"2.0.0p247 :466?>     end2.0.0p247 :467?>   end => nil 2.0.0p247 :468 > class MyString < String;end钩子函数 => nil 2.0.0p247 :469 > 


热点排行