At the root of the class hierarchy is the class Object, from which all other classes inherit. Every class has a set of methods which can be called on objects of that class. Methods are always called on an object — there are no “class methods”, as there are in many other languages (though Ruby does a great job of faking them).
Every object has a set of instance variables which hold the state of the object. Instance variables are created and accessed from within methods called on the object. Instance variables are completely private to an object. No other object can see them, not even other objects of the same class, or the class itself. All communication between Ruby objects happens through methods.
Скачать книгу можно бесплатно по данной ссылке: Скачать
0 Комментарии