Ruby:type()全局方法(Ruby: type() global method)
我只是好奇什么是type()全局方法。
我用它
a = 1 puts type(a)刚刚得到“错误的参数数量(1为0)”。
I'm just curious what the type() global method is.
I used it
a = 1 puts type(a)and just got "wrong number of arguments (1 for 0)".
最满意答案
这是一个不赞同的class ,相当于1.9。
>> send :class => Object >> 1.type (irb):5: warning: Object#type is deprecated; use Object#class => FixnumIt’s a deprecated equivalent of class, and it’s gone in 1.9.
>> send :class => Object >> 1.type (irb):5: warning: Object#type is deprecated; use Object#class => Fixnum更多推荐
发布评论