ruby Mixin用法
module My NA="China" attr:name attr:age def set_name(name) @name=name end def get_name return @name end def set_age(age) @age=age end end class Test include My end t=Test.new t.set_name("history") p t.get_name
posted on 2013-07-03 14:02 Ijavascript 阅读(182) 评论(0) 编辑 收藏 举报