首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

#Ruby# Introspect (二)

2012-11-11 
#Ruby# Introspect (2)3. Looking at Classes?superclass get the parent of any particular class?anc

#Ruby# Introspect (2)

3. Looking at Classes

?

superclass => get the parent of any particular class

?

ancestors => get both superclasses and mixin modules

?

在Ruby1.9中,任何未指定的class都继承自Object,而Object继承自BasicObject,BasicObject无superclass。

?

4. Looking inside Classes

?

?

str = %q{puts "hello".length}eval str # => 5

?

?

热点排行