Understanding Ruby’s
Object Model
Chris Pine
July 10, 2003
Chris Pine
Some Ruby Basics
1234567.class Fixnum
'hello'.class String
Chris Pine
Some Ruby Basics
1234567.class Fixnum
'hello'.class String
Fixnum.superclass Integer
String.superclass Object
Chris Pine
Some Ruby Basics
1234567.class Fixnum
'hello'.class String
Fixnum.superclass Integer
String.superclass Object
'hello'.kind_of?(String) true
1234567.kind_of?(Integer) true
1234567.kind_of?(String) false
Chris Pine
A Little Quiz
Object.kind_of?(Object) ?
评论0